Combine API request spec assertions (#31970)
This commit is contained in:
parent
1fce55cf5d
commit
b071e618e7
21 changed files with 36 additions and 232 deletions
|
@ -193,15 +193,11 @@ RSpec.describe 'Accounts' do
|
|||
it_behaves_like 'forbidden for wrong scope', 'write write:accounts read admin:read'
|
||||
it_behaves_like 'forbidden for wrong role', ''
|
||||
|
||||
it 'removes the user successfully', :aggregate_failures do
|
||||
it 'removes the user successfully and logs action', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(User.where(id: account.user.id)).to_not exist
|
||||
end
|
||||
|
||||
it 'logs action', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(latest_admin_action_log)
|
||||
.to be_present
|
||||
|
|
|
@ -73,14 +73,10 @@ RSpec.describe 'Tags' do
|
|||
it_behaves_like 'forbidden for wrong scope', 'write:statuses'
|
||||
it_behaves_like 'forbidden for wrong role', ''
|
||||
|
||||
it 'returns http success' do
|
||||
it 'returns http success and expected tag content' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns expected tag content' do
|
||||
subject
|
||||
|
||||
expect(response.parsed_body[:id].to_i).to eq(tag.id)
|
||||
expect(response.parsed_body[:name]).to eq(tag.name)
|
||||
|
@ -107,14 +103,10 @@ RSpec.describe 'Tags' do
|
|||
it_behaves_like 'forbidden for wrong scope', 'admin:read'
|
||||
it_behaves_like 'forbidden for wrong role', ''
|
||||
|
||||
it 'returns http success' do
|
||||
it 'returns http success and updates tag' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns updated tag' do
|
||||
subject
|
||||
|
||||
expect(response.parsed_body[:id].to_i).to eq(tag.id)
|
||||
expect(response.parsed_body[:name]).to eq(tag.name.upcase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue