2
0

Extract params hash for api/v1/push/subscriptions#create (#35475)

This commit is contained in:
Matt Jankowski
2025-07-24 03:49:20 -04:00
committed by GitHub
parent 469304359a
commit e54e96d61f
2 changed files with 35 additions and 19 deletions

View File

@@ -166,17 +166,30 @@ RSpec.describe 'API V1 Push Subscriptions' do
describe 'GET /api/v1/push/subscription' do
subject { get '/api/v1/push/subscription', headers: headers }
before { create_subscription_with_token }
context 'with a subscription' do
before { create_subscription_with_token }
it 'shows subscription details' do
subject
it 'shows subscription details' do
subject
expect(response)
.to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
expect(response.parsed_body)
.to include(endpoint: endpoint)
expect(response)
.to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
expect(response.parsed_body)
.to include(endpoint: endpoint)
end
end
context 'without a subscription' do
it 'returns not found' do
subject
expect(response)
.to have_http_status(404)
expect(response.content_type)
.to start_with('application/json')
end
end
end