fleet/server/datastore/datastore_app_test.go
Victor Vrantchan def24499b5 store WebAddress config in datastore (#421)
moves web address config to datastore so that it can be configured by a user
in the Web UI.
rename OrgInfo struct to AppConfig.

For #363
For #378
2016-11-04 16:44:38 -04:00

35 lines
716 B
Go

package datastore
import (
"testing"
"github.com/kolide/kolide-ose/server/kolide"
"github.com/stretchr/testify/assert"
)
func testOrgInfo(t *testing.T, ds kolide.Datastore) {
info := &kolide.AppConfig{
OrgName: "Kolide",
OrgLogoURL: "localhost:8080/logo.png",
}
info, err := ds.NewAppConfig(info)
assert.Nil(t, err)
info2, err := ds.AppConfig()
assert.Nil(t, err)
assert.Equal(t, info2.OrgName, info.OrgName)
info2.OrgName = "koolide"
err = ds.SaveAppConfig(info2)
assert.Nil(t, err)
info3, err := ds.AppConfig()
assert.Nil(t, err)
assert.Equal(t, info3.OrgName, info2.OrgName)
info4, err := ds.NewAppConfig(info3)
assert.Nil(t, err)
assert.Equal(t, info4.OrgName, info3.OrgName)
}