summaryrefslogtreecommitdiffstats
path: root/store/sql_session_store_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-26 20:32:24 -0500
committer=Corey Hulen <corey@hulen.com>2016-01-26 20:32:24 -0500
commitc2bc9454ce5550a180d8ee9fec75db7f3841b1ad (patch)
treebb56d39a6eb468dc002486723bdb085ca7b20a3b /store/sql_session_store_test.go
parent21d51f8c9094f434afed8d23d4790aea28a4c0df (diff)
downloadchat-c2bc9454ce5550a180d8ee9fec75db7f3841b1ad.tar.gz
chat-c2bc9454ce5550a180d8ee9fec75db7f3841b1ad.tar.bz2
chat-c2bc9454ce5550a180d8ee9fec75db7f3841b1ad.zip
PLT-1586 adding attach device id method
Diffstat (limited to 'store/sql_session_store_test.go')
-rw-r--r--store/sql_session_store_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/store/sql_session_store_test.go b/store/sql_session_store_test.go
index cec8e93b0..34d3128a6 100644
--- a/store/sql_session_store_test.go
+++ b/store/sql_session_store_test.go
@@ -157,6 +157,28 @@ func TestSessionRemoveToken(t *testing.T) {
}
}
+func TestSessionUpdateDeviceId(t *testing.T) {
+ Setup()
+
+ s1 := model.Session{}
+ s1.UserId = model.NewId()
+ s1.TeamId = model.NewId()
+ Must(store.Session().Save(&s1))
+
+ if rs1 := (<-store.Session().UpdateDeviceId(s1.Id, model.PUSH_NOTIFY_APPLE+":1234567890")); rs1.Err != nil {
+ t.Fatal(rs1.Err)
+ }
+
+ s2 := model.Session{}
+ s2.UserId = model.NewId()
+ s2.TeamId = model.NewId()
+ Must(store.Session().Save(&s2))
+
+ if rs2 := (<-store.Session().UpdateDeviceId(s2.Id, model.PUSH_NOTIFY_APPLE+":1234567890")); rs2.Err != nil {
+ t.Fatal(rs2.Err)
+ }
+}
+
func TestSessionStoreUpdateLastActivityAt(t *testing.T) {
Setup()