0
0
Fork 0

Destroy NotificationRequests that are dismissed (#31008)

This commit is contained in:
David Roetzel 2024-07-12 14:09:52 +02:00 committed by GitHub
parent c929b4cace
commit 35a437a03f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 57 additions and 40 deletions

View file

@ -4,9 +4,7 @@ require 'rails_helper'
RSpec.describe NotificationRequest do
describe '#reconsider_existence!' do
subject { Fabricate(:notification_request, dismissed: dismissed) }
let(:dismissed) { false }
subject { Fabricate(:notification_request) }
context 'when there are remaining notifications' do
before do
@ -28,14 +26,6 @@ RSpec.describe NotificationRequest do
subject.reconsider_existence!
end
context 'when dismissed' do
let(:dismissed) { true }
it 'leaves request intact' do
expect(subject.destroyed?).to be false
end
end
it 'removes the request' do
expect(subject.destroyed?).to be true
end