Use expect
for api/v1 and api/web push subs controllers (#33682)
This commit is contained in:
parent
b18caff5b6
commit
607f65a0a5
4 changed files with 42 additions and 4 deletions
|
@ -107,6 +107,13 @@ RSpec.describe 'API V1 Push Subscriptions' do
|
|||
|
||||
it_behaves_like 'validation error'
|
||||
end
|
||||
|
||||
it 'gracefully handles invalid nested params' do
|
||||
post api_v1_push_subscription_path, params: { subscription: 'invalid' }, headers: headers
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(400)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /api/v1/push/subscription' do
|
||||
|
@ -133,6 +140,13 @@ RSpec.describe 'API V1 Push Subscriptions' do
|
|||
policy: alerts_payload[:data][:policy]
|
||||
)
|
||||
end
|
||||
|
||||
it 'gracefully handles invalid nested params' do
|
||||
put api_v1_push_subscription_path(endpoint_push_subscription), params: { data: 'invalid' }, headers: headers
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(400)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /api/v1/push/subscription' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue