Merge remote-tracking branch 'parent/main' into upstream-20240123
This commit is contained in:
commit
50ae2d9439
320 changed files with 2587 additions and 2817 deletions
|
@ -64,6 +64,7 @@ RSpec.describe 'credentials API' do
|
|||
indexable: true,
|
||||
locked: false,
|
||||
note: 'Hello!',
|
||||
attribution_domains: ['example.com'],
|
||||
source: {
|
||||
privacy: 'unlisted',
|
||||
sensitive: true,
|
||||
|
@ -121,7 +122,8 @@ RSpec.describe 'credentials API' do
|
|||
display_name: eq("Alice Isn't Dead"),
|
||||
note: 'Hello!',
|
||||
avatar: exist,
|
||||
header: exist
|
||||
header: exist,
|
||||
attribution_domains: ['example.com']
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -52,4 +52,28 @@ RSpec.describe 'API Web Push Subscriptions' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /api/web/push_subscriptions' do
|
||||
before { sign_in Fabricate :user }
|
||||
|
||||
it 'gracefully handles invalid nested params' do
|
||||
post api_web_push_subscriptions_path, params: { subscription: 'invalid' }
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(400)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /api/web/push_subscriptions' do
|
||||
before { sign_in Fabricate :user }
|
||||
|
||||
let(:subscription) { Fabricate :web_push_subscription }
|
||||
|
||||
it 'gracefully handles invalid nested params' do
|
||||
put api_web_push_subscription_path(subscription), params: { data: 'invalid' }
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(400)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue