summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-26 11:45:03 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-26 11:45:09 -0400
commit663bec814767fa9c92e7ab2c706c0fe4c0432cf1 (patch)
tree2d16013429e3e4facb690c6fb43f5cb53489323e /api
parent2383d5dd37d5ebf28c2576fd495a8a7f02f78901 (diff)
downloadchat-663bec814767fa9c92e7ab2c706c0fe4c0432cf1.tar.gz
chat-663bec814767fa9c92e7ab2c706c0fe4c0432cf1.tar.bz2
chat-663bec814767fa9c92e7ab2c706c0fe4c0432cf1.zip
Moved logic for searching for posts by multiple users/channels into the sql query
Diffstat (limited to 'api')
-rw-r--r--api/post_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/api/post_test.go b/api/post_test.go
index 3df622d84..e54e9ef0c 100644
--- a/api/post_test.go
+++ b/api/post_test.go
@@ -546,6 +546,9 @@ func TestSearchPostsFromUser(t *testing.T) {
Client.Must(Client.JoinChannel(channel1.Id))
Client.Must(Client.JoinChannel(channel2.Id))
+ // wait for the join/leave messages to be created for user3 since they're done asynchronously
+ time.Sleep(100 * time.Millisecond)
+
if result := Client.Must(Client.SearchPosts("from: " + user2.Username)).Data.(*model.PostList); len(result.Order) != 3 {
t.Fatalf("wrong number of posts returned %v", len(result.Order))
}