Remove double subject call in `api/v1/admin/ip_blocks` spec (#28696)

th-new
Matt Jankowski 2024-01-11 10:11:57 -05:00 committed by GitHub
parent b68f185573
commit 95bd46d32a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -177,7 +177,9 @@ RSpec.describe 'IP Blocks' do
let(:params) { { severity: 'sign_up_requires_approval', comment: 'Decreasing severity' } } let(:params) { { severity: 'sign_up_requires_approval', comment: 'Decreasing severity' } }
it 'returns the correct ip block', :aggregate_failures do it 'returns the correct ip block', :aggregate_failures do
subject expect { subject }
.to change_severity_level
.and change_comment_value
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(body_as_json).to match(hash_including({ expect(body_as_json).to match(hash_including({
@ -187,12 +189,12 @@ RSpec.describe 'IP Blocks' do
})) }))
end end
it 'updates the severity correctly' do def change_severity_level
expect { subject }.to change { ip_block.reload.severity }.from('no_access').to('sign_up_requires_approval') change { ip_block.reload.severity }.from('no_access').to('sign_up_requires_approval')
end end
it 'updates the comment correctly' do def change_comment_value
expect { subject }.to change { ip_block.reload.comment }.from('Spam').to('Decreasing severity') change { ip_block.reload.comment }.from('Spam').to('Decreasing severity')
end end
context 'when ip block does not exist' do context 'when ip block does not exist' do