summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-02-23 08:53:43 -0500
committerJoram Wilander <jwawilander@gmail.com>2017-02-23 08:53:43 -0500
commitca7d3b6e7bc2e52cf40180a462492313f298e760 (patch)
tree4401b86f65d5a31bdaf3162a43969509b1f30229 /store
parent3b0f7163ab7e58a04c1fcadf7f615448bd4395a0 (diff)
downloadchat-ca7d3b6e7bc2e52cf40180a462492313f298e760.tar.gz
chat-ca7d3b6e7bc2e52cf40180a462492313f298e760.tar.bz2
chat-ca7d3b6e7bc2e52cf40180a462492313f298e760.zip
Adding device Id for version 2 of native apps (#5505)
* Adding device Id for version 2 * Changing ids
Diffstat (limited to 'store')
-rw-r--r--store/sql_session_store_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/store/sql_session_store_test.go b/store/sql_session_store_test.go
index 24526a4a9..aa088b377 100644
--- a/store/sql_session_store_test.go
+++ b/store/sql_session_store_test.go
@@ -197,6 +197,26 @@ func TestSessionUpdateDeviceId(t *testing.T) {
}
}
+func TestSessionUpdateDeviceId2(t *testing.T) {
+ Setup()
+
+ s1 := model.Session{}
+ s1.UserId = model.NewId()
+ Must(store.Session().Save(&s1))
+
+ if rs1 := (<-store.Session().UpdateDeviceId(s1.Id, model.PUSH_NOTIFY_APPLE_REACT_NATIVE+":1234567890", s1.ExpiresAt)); rs1.Err != nil {
+ t.Fatal(rs1.Err)
+ }
+
+ s2 := model.Session{}
+ s2.UserId = model.NewId()
+ Must(store.Session().Save(&s2))
+
+ if rs2 := (<-store.Session().UpdateDeviceId(s2.Id, model.PUSH_NOTIFY_APPLE_REACT_NATIVE+":1234567890", s1.ExpiresAt)); rs2.Err != nil {
+ t.Fatal(rs2.Err)
+ }
+}
+
func TestSessionStoreUpdateLastActivityAt(t *testing.T) {
Setup()