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

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