Various fixes to data access

This commit is contained in:
Torkel Ödegaard
2015-01-20 15:23:14 +01:00
parent 0a695ba17a
commit 4ea5d80099
8 changed files with 27 additions and 8 deletions
+10 -1
View File
@@ -59,8 +59,8 @@ func TestAccountDataAccess(t *testing.T) {
err := GetSignedInUser(&query)
So(err, ShouldBeNil)
So(query.Result.AccountId, ShouldEqual, ac2.AccountId)
So(query.Result.Email, ShouldEqual, "ac2@test.com")
So(query.Result.AccountId, ShouldEqual, ac2.AccountId)
So(query.Result.Name, ShouldEqual, "ac2 name")
So(query.Result.Login, ShouldEqual, "ac2")
So(query.Result.AccountRole, ShouldEqual, "Admin")
@@ -76,6 +76,15 @@ func TestAccountDataAccess(t *testing.T) {
So(len(query.Result), ShouldEqual, 2)
})
Convey("Can get account users", func() {
query := m.GetAccountUsersQuery{AccountId: ac1.AccountId}
err := GetAccountUsers(&query)
So(err, ShouldBeNil)
So(len(query.Result), ShouldEqual, 2)
So(query.Result[0].Role, ShouldEqual, "Admin")
})
Convey("Can set using account", func() {
cmd := m.SetUsingAccountCommand{UserId: ac2.Id, AccountId: ac1.Id}
err := SetUsingAccount(&cmd)