0
0
Fork 0

Reload notifications when accepted notifications are merged (streaming only) (#31419)

This commit is contained in:
Claire 2024-08-19 17:59:06 +02:00 committed by GitHub
parent d4f135bc6d
commit 53c183f899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 192 additions and 24 deletions

View file

@ -120,4 +120,34 @@ RSpec.describe 'Requests' do
expect(response).to have_http_status(200)
end
end
describe 'GET /api/v1/notifications/requests/merged' do
subject do
get '/api/v1/notifications/requests/merged', headers: headers
end
it_behaves_like 'forbidden for wrong scope', 'write write:notifications'
context 'when the user has no accepted request pending merge' do
it 'returns http success and returns merged: true' do
subject
expect(response).to have_http_status(200)
expect(body_as_json).to eq({ merged: true })
end
end
context 'when the user has an accepted request pending merge' do
before do
redis.set("notification_unfilter_jobs:#{user.account_id}", 1)
end
it 'returns http success and returns merged: false' do
subject
expect(response).to have_http_status(200)
expect(body_as_json).to eq({ merged: false })
end
end
end
end