summaryrefslogtreecommitdiffstats
path: root/store/sql_file_info_store_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_file_info_store_test.go')
-rw-r--r--store/sql_file_info_store_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/store/sql_file_info_store_test.go b/store/sql_file_info_store_test.go
index edb9dbd54..672e15ef2 100644
--- a/store/sql_file_info_store_test.go
+++ b/store/sql_file_info_store_test.go
@@ -114,7 +114,13 @@ func TestFileInfoGetForPost(t *testing.T) {
infos[i] = Must(store.FileInfo().Save(info)).(*model.FileInfo)
}
- if result := <-store.FileInfo().GetForPost(postId); result.Err != nil {
+ if result := <-store.FileInfo().GetForPost(postId, 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 {
t.Fatal(result.Err)
} else if returned := result.Data.([]*model.FileInfo); len(returned) != 2 {
t.Fatal("should've returned exactly 2 file infos")
@@ -157,7 +163,7 @@ func TestFileInfoAttachToPost(t *testing.T) {
info2 = Must(store.FileInfo().Get(info2.Id)).(*model.FileInfo)
}
- if result := <-store.FileInfo().GetForPost(postId); result.Err != nil {
+ if result := <-store.FileInfo().GetForPost(postId, 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")
@@ -202,7 +208,7 @@ func TestFileInfoDeleteForPost(t *testing.T) {
t.Fatal(result.Err)
}
- if infos := Must(store.FileInfo().GetForPost(postId)).([]*model.FileInfo); len(infos) != 0 {
+ if infos := Must(store.FileInfo().GetForPost(postId, false)).([]*model.FileInfo); len(infos) != 0 {
t.Fatal("shouldn't have returned any file infos")
}
}