diff options
author | Matt Jankowski <matt@jankowski.online> | 2024-01-26 09:10:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 14:10:26 +0000 |
commit | 9cc1817bb493799b89d1171a1d632abb9791340c (patch) | |
tree | bad4872dd26f47638253fef2c2adeff9e1c91b73 | |
parent | 805dba7f8d2a2d5f910ec1396247b36417170345 (diff) |
Fix intmermittent failure in `api/v1/accounts/statuses` controller spec (#28931)
-rw-r--r-- | spec/controllers/api/v1/accounts/statuses_controller_spec.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb index df71e94ace7..9bf385c03dc 100644 --- a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb @@ -39,11 +39,14 @@ describe Api::V1::Accounts::StatusesController do end it 'returns posts along with self replies', :aggregate_failures do - json = body_as_json - post_ids = json.map { |item| item[:id].to_i }.sort - - expect(response).to have_http_status(200) - expect(post_ids).to eq [status.id, status_self_reply.id] + expect(response) + .to have_http_status(200) + expect(body_as_json) + .to have_attributes(size: 2) + .and contain_exactly( + include(id: status.id.to_s), + include(id: status_self_reply.id.to_s) + ) end end |