DEV: Ignore order of categories in search spec.

This commit is contained in:
Guo Xiang Tan 2020-07-16 09:28:45 +08:00
parent 1e9ce51151
commit 8ceb7f490f
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
1 changed files with 5 additions and 5 deletions

View File

@ -639,8 +639,8 @@ describe Search do
it "should return the right categories" do
search = Search.execute("monkey")
expect(search.categories).to eq(
[category, ignored_category]
expect(search.categories).to contain_exactly(
category, ignored_category
)
expect(search.posts).to eq([category.topic.first_post, post])
@ -683,12 +683,12 @@ describe Search do
expect(search.posts.map(&:id)).to eq([post2.id, post.id])
category.set_permissions({})
category.save
category.save!
search = Search.execute("monkey")
expect(search.categories).to eq([
expect(search.categories).to contain_exactly(
ignored_category, child_of_ignored_category
])
)
expect(search.posts.map(&:id)).to eq([
child_of_ignored_category.topic.first_post,