Merge remote-tracking branch 'parent/main' into upstream-20240117
This commit is contained in:
commit
5d79bd078c
150 changed files with 2982 additions and 1485 deletions
|
@ -258,6 +258,19 @@ RSpec.describe 'Domain Blocks' do
|
|||
.to start_with('application/json')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when severity is invalid' do
|
||||
let(:params) { { domain: 'bar.com', severity: :bar } }
|
||||
|
||||
it 'returns http unprocessable entity' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:error]).to eq('Validation failed: Severity is not included in the list')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /api/v1/admin/domain_blocks/:id' do
|
||||
|
|
|
@ -187,6 +187,16 @@ RSpec.describe 'IP Blocks' do
|
|||
.to start_with('application/json')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the given severity is invalid' do
|
||||
let(:params) { { ip: '151.0.32.55', severity: 'invalid' } }
|
||||
|
||||
it 'returns http unprocessable entity' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /api/v1/admin/ip_blocks/:id' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue