Prefer structure checks over multi-line size/parts checks in parsed_body
(#32063)
This commit is contained in:
parent
d6f5ee75ab
commit
51777fe3e2
6 changed files with 60 additions and 37 deletions
|
@ -36,8 +36,6 @@ RSpec.describe 'API V1 Statuses Favourited by Accounts' do
|
|||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body.size)
|
||||
.to eq(2)
|
||||
expect(response.parsed_body)
|
||||
.to contain_exactly(
|
||||
include(id: alice.id.to_s),
|
||||
|
@ -50,9 +48,10 @@ RSpec.describe 'API V1 Statuses Favourited by Accounts' do
|
|||
|
||||
subject
|
||||
|
||||
expect(response.parsed_body.size)
|
||||
.to eq 1
|
||||
expect(response.parsed_body.first[:id]).to eq(alice.id.to_s)
|
||||
expect(response.parsed_body)
|
||||
.to contain_exactly(
|
||||
hash_including(id: alice.id.to_s)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,8 +35,6 @@ RSpec.describe 'API V1 Statuses Reblogged by Accounts' do
|
|||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body.size)
|
||||
.to eq(2)
|
||||
expect(response.parsed_body)
|
||||
.to contain_exactly(
|
||||
include(id: alice.id.to_s),
|
||||
|
@ -49,9 +47,10 @@ RSpec.describe 'API V1 Statuses Reblogged by Accounts' do
|
|||
|
||||
subject
|
||||
|
||||
expect(response.parsed_body.size)
|
||||
.to eq 1
|
||||
expect(response.parsed_body.first[:id]).to eq(alice.id.to_s)
|
||||
expect(response.parsed_body)
|
||||
.to contain_exactly(
|
||||
hash_including(id: alice.id.to_s)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue