Fix intermittent failure from unspecified order in `api/v1/accounts/relationships` spec (#28306)

pull/2535/head^2
Matt Jankowski 2023-12-11 02:55:07 -05:00 committed by GitHub
parent b82fc8a2ca
commit 11d2bd9716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 18 deletions

View File

@ -31,8 +31,8 @@ describe 'GET /api/v1/accounts/relationships' do
.to have_http_status(200) .to have_http_status(200)
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and contain_exactly(
first: include( include(
following: true, following: true,
followed_by: false followed_by: false
) )
@ -53,9 +53,11 @@ describe 'GET /api/v1/accounts/relationships' do
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and have_attributes(
size: 2, size: 2
first: include(simon_item), )
second: include(lewis_item) .and contain_exactly(
include(simon_item),
include(lewis_item)
) )
end end
end end
@ -71,10 +73,12 @@ describe 'GET /api/v1/accounts/relationships' do
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and have_attributes(
size: 3, size: 3
first: include(simon_item), )
second: include(lewis_item), .and contain_exactly(
third: include(bob_item) include(simon_item),
include(lewis_item),
include(bob_item)
) )
end end
end end
@ -88,9 +92,11 @@ describe 'GET /api/v1/accounts/relationships' do
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and have_attributes(
size: 2, size: 2
first: include(simon_item), )
second: include(lewis_item) .and contain_exactly(
include(simon_item),
include(lewis_item)
) )
end end
end end
@ -116,7 +122,6 @@ describe 'GET /api/v1/accounts/relationships' do
muting: false, muting: false,
requested: false, requested: false,
domain_blocking: false, domain_blocking: false,
} }
end end
@ -129,7 +134,6 @@ describe 'GET /api/v1/accounts/relationships' do
muting: false, muting: false,
requested: false, requested: false,
domain_blocking: false, domain_blocking: false,
} }
end end
end end
@ -149,8 +153,10 @@ describe 'GET /api/v1/accounts/relationships' do
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and have_attributes(
size: 1, size: 1
first: include( )
.and contain_exactly(
include(
following: true, following: true,
showing_reblogs: true showing_reblogs: true
) )
@ -168,8 +174,8 @@ describe 'GET /api/v1/accounts/relationships' do
expect(body_as_json) expect(body_as_json)
.to be_an(Enumerable) .to be_an(Enumerable)
.and have_attributes( .and contain_exactly(
first: include( include(
following: false, following: false,
showing_reblogs: false showing_reblogs: false
) )