DEV: Fix flaky test (#21880)

```
  1) TopicsFilter#filter_from_query_string ordering topics filter when ordering topics by creation date when query string is `order:created-invalid` should return topics ordered by the default order
     Failure/Error:
       expect(
         TopicsFilter
           .new(guardian: Guardian.new)
           .filter_from_query_string("order:#{order}-invalid")
           .pluck(:id),
       ).to eq(Topic.all.order(:id).pluck(:id))

       expected: [484, 485, 486]
            got: [486, 484, 485]
```
This commit is contained in:
Alan Guo Xiang Tan 2023-06-01 16:47:33 +09:00 committed by GitHub
parent 576d389ded
commit 0494157452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1246,13 +1246,13 @@ RSpec.describe TopicsFilter do
end end
describe "when query string is `order:#{order}-invalid`" do describe "when query string is `order:#{order}-invalid`" do
it "should return topics ordered by the default order" do it "should return topics ordered by the database's default order" do
expect( expect(
TopicsFilter TopicsFilter
.new(guardian: Guardian.new) .new(guardian: Guardian.new)
.filter_from_query_string("order:#{order}-invalid") .filter_from_query_string("order:#{order}-invalid")
.pluck(:id), .pluck(:id),
).to eq(Topic.all.order(:id).pluck(:id)) ).to contain_exactly(*Topic.all.pluck(:id))
end end
end end
end end