DEV: Fix randomly failing search spec.

This commit is contained in:
Guo Xiang Tan 2019-04-03 16:04:00 +08:00
parent b360d4289e
commit c10861da2f

View File

@ -347,13 +347,15 @@ describe Search do
)
post2 = Fabricate(:post,
raw: "I think winter winter winter winter winter will end soon",
raw: "I think #{'winter' * 20} will end soon",
topic: Fabricate(:topic, title: "dragon john snow summer", category: category)
)
result = Search.execute('winter')
expect(result.posts).to eq([post, post2, category.topic.first_post])
expect(result.posts.pluck(:id)).to eq([
post.id, category.topic.first_post.id, post2.id
])
end
end