fix tests

This commit is contained in:
r888888888
2017-03-15 16:08:47 -07:00
parent da06bee0ab
commit d9a26975ba
9 changed files with 25 additions and 33 deletions

View File

@@ -1951,8 +1951,8 @@ class PostTest < ActiveSupport::TestCase
should "return posts for a search:<category> metatag" do
post1 = FactoryGirl.create(:post, tag_string: "aaa")
post2 = FactoryGirl.create(:post, tag_string: "bbb")
FactoryGirl.create(:saved_search, tag_query: "aaa", category: "zzz", user: CurrentUser.user)
FactoryGirl.create(:saved_search, tag_query: "bbb", category: nil, user: CurrentUser.user)
FactoryGirl.create(:saved_search, query: "aaa", labels: ["zzz"], user: CurrentUser.user)
FactoryGirl.create(:saved_search, query: "bbb", user: CurrentUser.user)
SavedSearch.expects(:post_ids).with(CurrentUser.id, "zzz").returns([post1.id])
SavedSearch.expects(:post_ids).with(CurrentUser.id, "uncategorized").returns([post2.id])