mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
def24499b5
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
35 lines
716 B
Go
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)
|
|
}
|