fleet/server/datastore/datastore_app_test.go

35 lines
704 B
Go
Raw Normal View History

package datastore
import (
"testing"
2016-09-26 18:48:55 +00:00
"github.com/kolide/kolide-ose/server/kolide"
"github.com/stretchr/testify/assert"
)
func testOrgInfo(t *testing.T, ds kolide.Datastore) {
info := &kolide.OrgInfo{
OrgName: "Kolide",
OrgLogoURL: "localhost:8080/logo.png",
}
info, err := ds.NewOrgInfo(info)
assert.Nil(t, err)
info2, err := ds.OrgInfo()
assert.Nil(t, err)
assert.Equal(t, info2.OrgName, info.OrgName)
info2.OrgName = "koolide"
err = ds.SaveOrgInfo(info2)
assert.Nil(t, err)
info3, err := ds.OrgInfo()
assert.Nil(t, err)
assert.Equal(t, info3.OrgName, info2.OrgName)
info4, err := ds.NewOrgInfo(info3)
assert.Nil(t, err)
assert.Equal(t, info4.OrgName, info3.OrgName)
}