Merge commit '53c183f899b5382f1eebd72e34a090c30f8eba6a' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2024-08-19 18:25:31 +02:00
commit 1760f84349
54 files changed
+1054 -447

No files matched your search

@@ -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
+1 -1
View File
@@ -185,7 +185,7 @@ RSpec.describe 'Notifications' do
it 'returns the requested number of notifications paginated', :aggregate_failures do
subject
notifications = user.account.notifications.browserable
notifications = user.account.notifications.browserable.order(id: :asc)
expect(body_as_json.size)
.to eq(params[:limit])