Combine API request spec assertions (#31970)
This commit is contained in:
parent
1fce55cf5d
commit
b071e618e7
21 changed files with 36 additions and 232 deletions
|
@ -18,15 +18,11 @@ RSpec.describe 'Pins' do
|
|||
it_behaves_like 'forbidden for wrong scope', 'read read:accounts'
|
||||
|
||||
context 'when the status is public' do
|
||||
it 'pins the status successfully', :aggregate_failures do
|
||||
it 'pins the status successfully and returns updated json', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(user.account.pinned?(status)).to be true
|
||||
end
|
||||
|
||||
it 'return json with updated attributes' do
|
||||
subject
|
||||
|
||||
expect(response.parsed_body).to match(
|
||||
a_hash_including(id: status.id.to_s, pinned: true)
|
||||
|
@ -86,15 +82,11 @@ RSpec.describe 'Pins' do
|
|||
Fabricate(:status_pin, status: status, account: user.account)
|
||||
end
|
||||
|
||||
it 'unpins the status successfully', :aggregate_failures do
|
||||
it 'unpins the status successfully and includes updated json', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(user.account.pinned?(status)).to be false
|
||||
end
|
||||
|
||||
it 'return json with updated attributes' do
|
||||
subject
|
||||
|
||||
expect(response.parsed_body).to match(
|
||||
a_hash_including(id: status.id.to_s, pinned: false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue