diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-08 10:41:00 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-08 12:41:00 -0300 |
commit | caec18a2fbc1152a456042418c49e29c89ee3249 (patch) | |
tree | a862a4eaaf8dede85ad0f5fffc999305e84eea4f /api | |
parent | ba8c98d722975ef1a1b395f153955aaa1af72866 (diff) | |
download | chat-caec18a2fbc1152a456042418c49e29c89ee3249.tar.gz chat-caec18a2fbc1152a456042418c49e29c89ee3249.tar.bz2 chat-caec18a2fbc1152a456042418c49e29c89ee3249.zip |
Handled possible race confition in TestGetMessageForNotification (#4737)
Diffstat (limited to 'api')
-rw-r--r-- | api/post_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/post_test.go b/api/post_test.go index 497a283bc..fd0c0b24b 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -1267,7 +1267,7 @@ func TestGetMessageForNotification(t *testing.T) { post.FileIds = model.StringArray{testPng.Id, testJpg1.Id} store.Must(Srv.Store.FileInfo().AttachToPost(testJpg1.Id, post.Id)) - if message := getMessageForNotification(post, translateFunc); message != "2 images sent: test1.png, test2.jpg" { + if message := getMessageForNotification(post, translateFunc); message != "2 images sent: test1.png, test2.jpg" && message != "2 images sent: test2.jpg, test1.png" { t.Fatal("should've returned number of images:", message) } @@ -1280,7 +1280,7 @@ func TestGetMessageForNotification(t *testing.T) { store.Must(Srv.Store.FileInfo().AttachToPost(testJpg2.Id, post.Id)) post.FileIds = model.StringArray{testFile.Id, testJpg2.Id} - if message := getMessageForNotification(post, translateFunc); message != "2 files sent: test1.go, test3.jpg" { + if message := getMessageForNotification(post, translateFunc); message != "2 files sent: test1.go, test3.jpg" && message != "2 files sent: test3.jpg, test1.go" { t.Fatal("should've returned number of mixed files:", message) } } |