diff options
author | Corey Hulen <corey@hulen.com> | 2016-05-12 18:36:30 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-05-12 18:36:30 -0700 |
commit | 9d94869cc6a0fb9f051879437c104ccd76094380 (patch) | |
tree | 4a61582c2a41b9d5983f107b0d66ece906d22718 /store/sql_user_store_test.go | |
parent | e46c1b8d52dce75a442b42c40803a071532676d7 (diff) | |
download | chat-9d94869cc6a0fb9f051879437c104ccd76094380.tar.gz chat-9d94869cc6a0fb9f051879437c104ccd76094380.tar.bz2 chat-9d94869cc6a0fb9f051879437c104ccd76094380.zip |
Fixing issue with missing user (#2989)
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r-- | store/sql_user_store_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go index 5c33ea0f1..b6cfbb0ec 100644 --- a/store/sql_user_store_test.go +++ b/store/sql_user_store_test.go @@ -105,6 +105,30 @@ func TestUserStoreUpdate(t *testing.T) { } } +func TestUserStoreUpdateUpdateAt(t *testing.T) { + Setup() + + u1 := &model.User{} + u1.Email = model.NewId() + Must(store.User().Save(u1)) + Must(store.Team().SaveMember(&model.TeamMember{TeamId: model.NewId(), UserId: u1.Id})) + + time.Sleep(10 * time.Millisecond) + + if err := (<-store.User().UpdateUpdateAt(u1.Id)).Err; err != nil { + t.Fatal(err) + } + + if r1 := <-store.User().Get(u1.Id); r1.Err != nil { + t.Fatal(r1.Err) + } else { + if r1.Data.(*model.User).UpdateAt <= u1.UpdateAt { + t.Fatal("UpdateAt not updated correctly") + } + } + +} + func TestUserStoreUpdateLastPingAt(t *testing.T) { Setup() |