mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Change dismissing a notification to clear existing filtered notifications for that account (#31329)
This commit is contained in:
19
spec/services/dismiss_notification_request_service_spec.rb
Normal file
19
spec/services/dismiss_notification_request_service_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DismissNotificationRequestService do
|
||||
describe '#call' do
|
||||
let(:sender) { Fabricate(:account) }
|
||||
let(:receiver) { Fabricate(:account) }
|
||||
let(:request) { Fabricate(:notification_request, account: receiver, from_account: sender) }
|
||||
|
||||
it 'destroys the request and queues a worker', :aggregate_failures do
|
||||
expect { described_class.new.call(request) }
|
||||
.to change(request, :destroyed?).to(true)
|
||||
|
||||
expect(FilteredNotificationCleanupWorker)
|
||||
.to have_enqueued_sidekiq_job(receiver.id, sender.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user