accounts_test.go 580 B

1234567891011121314151617181920212223242526272829303132
  1. package sqlstore
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. m "github.com/torkelo/grafana-pro/pkg/models"
  6. )
  7. func TestAccountDataAccess(t *testing.T) {
  8. Convey("Testing Account DB Access", t, func() {
  9. InitTestDB(t)
  10. Convey("Can save account", func() {
  11. account := m.Account{
  12. Login: "login",
  13. Email: "login@test.com",
  14. Name: "name",
  15. }
  16. err := SaveAccount(&account)
  17. query := m.GetAccountInfoQuery{Id: account.Id}
  18. err = GetAccountInfo(&query)
  19. So(err, ShouldBeNil)
  20. So(query.Result.Name, ShouldEqual, "name")
  21. })
  22. })
  23. }