From ca7d3b6e7bc2e52cf40180a462492313f298e760 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 23 Feb 2017 08:53:43 -0500 Subject: Adding device Id for version 2 of native apps (#5505) * Adding device Id for version 2 * Changing ids --- store/sql_session_store_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'store/sql_session_store_test.go') 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() -- cgit v1.2.3-1-g7c22