Merge commit 'ad95c98054574080ac5d15584b3018d1db836531' into glitch-soc/merge-upstream

Conflicts:
- `package.json`:
  Upstream removed their direct dependency `autoprefixer`, which was textually adjacent
  to glitch-soc-only dependency `atrament`.
  Removed direct dependency on `autoprefixer`.
- `yarn.lock`:
  Upstream removed their direct dependency `autoprefixer`, which was textually adjacent
  to glitch-soc-only dependency `atrament`.
  Removed direct dependency on `autoprefixer`.
This commit is contained in:
Claire
2024-08-02 18:09:48 +02:00
114 changed files with 1054 additions and 671 deletions

View File

@@ -87,4 +87,37 @@ RSpec.describe 'Requests' do
end
end
end
describe 'POST /api/v1/notifications/requests/accept' do
subject do
post '/api/v1/notifications/requests/accept', params: { id: [notification_request.id] }, headers: headers
end
let!(:notification_request) { Fabricate(:notification_request, account: user.account) }
it_behaves_like 'forbidden for wrong scope', 'read read:notifications'
it 'returns http success and creates notification permission', :aggregate_failures do
subject
expect(NotificationPermission.find_by(account: notification_request.account, from_account: notification_request.from_account)).to_not be_nil
expect(response).to have_http_status(200)
end
end
describe 'POST /api/v1/notifications/requests/dismiss' do
subject do
post '/api/v1/notifications/requests/dismiss', params: { id: [notification_request.id] }, headers: headers
end
let!(:notification_request) { Fabricate(:notification_request, account: user.account) }
it_behaves_like 'forbidden for wrong scope', 'read read:notifications'
it 'returns http success and destroys the notification request', :aggregate_failures do
expect { subject }.to change(NotificationRequest, :count).by(-1)
expect(response).to have_http_status(200)
end
end
end