diff options
author | Corey Hulen <corey@hulen.com> | 2017-02-20 13:40:32 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-02-20 13:40:32 -0500 |
commit | 274b9b6032572dd33b28815a9c13bb18a02becbe (patch) | |
tree | 1fd47c65c854117d698d92b5cef701b59d4f9ebc /store/sql_file_info_store_test.go | |
parent | dd4d8440eac2e4b64bfb6b449cc0668b78ecba50 (diff) | |
download | chat-274b9b6032572dd33b28815a9c13bb18a02becbe.tar.gz chat-274b9b6032572dd33b28815a9c13bb18a02becbe.tar.bz2 chat-274b9b6032572dd33b28815a9c13bb18a02becbe.zip |
Fixing file info caching issue with Aurora for master (#5477)
Diffstat (limited to 'store/sql_file_info_store_test.go')
-rw-r--r-- | store/sql_file_info_store_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/store/sql_file_info_store_test.go b/store/sql_file_info_store_test.go index 672e15ef2..5e4d0e66e 100644 --- a/store/sql_file_info_store_test.go +++ b/store/sql_file_info_store_test.go @@ -114,13 +114,19 @@ func TestFileInfoGetForPost(t *testing.T) { infos[i] = Must(store.FileInfo().Save(info)).(*model.FileInfo) } - if result := <-store.FileInfo().GetForPost(postId, false); result.Err != nil { + if result := <-store.FileInfo().GetForPost(postId, true, false); result.Err != nil { t.Fatal(result.Err) } else if returned := result.Data.([]*model.FileInfo); len(returned) != 2 { t.Fatal("should've returned exactly 2 file infos") } - if result := <-store.FileInfo().GetForPost(postId, true); result.Err != nil { + if result := <-store.FileInfo().GetForPost(postId, false, false); result.Err != nil { + t.Fatal(result.Err) + } else if returned := result.Data.([]*model.FileInfo); len(returned) != 2 { + t.Fatal("should've returned exactly 2 file infos") + } + + if result := <-store.FileInfo().GetForPost(postId, true, true); result.Err != nil { t.Fatal(result.Err) } else if returned := result.Data.([]*model.FileInfo); len(returned) != 2 { t.Fatal("should've returned exactly 2 file infos") @@ -163,7 +169,7 @@ func TestFileInfoAttachToPost(t *testing.T) { info2 = Must(store.FileInfo().Get(info2.Id)).(*model.FileInfo) } - if result := <-store.FileInfo().GetForPost(postId, false); result.Err != nil { + if result := <-store.FileInfo().GetForPost(postId, true, false); result.Err != nil { t.Fatal(result.Err) } else if infos := result.Data.([]*model.FileInfo); len(infos) != 2 { t.Fatal("should've returned exactly 2 file infos") @@ -208,7 +214,7 @@ func TestFileInfoDeleteForPost(t *testing.T) { t.Fatal(result.Err) } - if infos := Must(store.FileInfo().GetForPost(postId, false)).([]*model.FileInfo); len(infos) != 0 { + if infos := Must(store.FileInfo().GetForPost(postId, true, false)).([]*model.FileInfo); len(infos) != 0 { t.Fatal("shouldn't have returned any file infos") } } |