0
0
Fork 0

Fix some flaky tests that randomly failed because of item ordering (#17509)

This commit is contained in:
Claire 2022-02-10 22:00:10 +01:00 committed by GitHub
parent 2af03164cb
commit 472bc89611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 20 deletions

View file

@ -47,7 +47,7 @@ RSpec.describe ActivityPub::FollowersSynchronizationsController, type: :controll
it 'returns orderedItems with followers from example.com' do
expect(body[:orderedItems]).to be_an Array
expect(body[:orderedItems].sort).to eq [follower_4.uri, follower_1.uri, follower_2.uri]
expect(body[:orderedItems]).to match_array([follower_4.uri, follower_1.uri, follower_2.uri])
end
it 'returns private Cache-Control header' do

View file

@ -79,7 +79,7 @@ describe Api::V1::Accounts::StatusesController do
it 'lists both the public and the private statuses' do
get :index, params: { account_id: account.id, pinned: true }
json = body_as_json
expect(json.map { |item| item[:id].to_i }.sort).to eq [status.id, private_status.id].sort
expect(json.map { |item| item[:id].to_i }).to match_array([status.id, private_status.id])
end
end
end