mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Add spec for marking all notifications as read
This commit is contained in:
parent
ba265e3c26
commit
118c7b5704
1 changed files with 16 additions and 0 deletions
|
|
@ -56,5 +56,21 @@ RSpec.describe '/notifications', type: :request do
|
|||
expect(response).to redirect_to(notifications_url)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /mark_as_read' do
|
||||
let!(:notification) { create(:notification, user:, read_at: nil) }
|
||||
|
||||
it 'marks all notifications as read' do
|
||||
post mark_notifications_as_read_url
|
||||
|
||||
expect(notification.reload.read_at).to be_present
|
||||
end
|
||||
|
||||
it 'redirects to the notifications list' do
|
||||
post mark_notifications_as_read_url
|
||||
|
||||
expect(response).to redirect_to(notifications_url)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue