Fix: mark all as read wasn't refreshing in the notifications screen

This commit is contained in:
Jorge Manrubia
2025-11-04 06:12:30 +01:00
parent 3608667cd4
commit 8aead31200
3 changed files with 23 additions and 2 deletions
@@ -5,11 +5,21 @@ class Notifications::BulkReadingsControllerTest < ActionDispatch::IntegrationTes
sign_in_as :kevin
end
test "create" do
test "create marks all notifications as read" do
assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: false, to: true do
assert_changes -> { notifications(:layout_commented_kevin).reload.read? }, from: false, to: true do
post bulk_reading_path
end
end
end
test "create redirects to notifications path when not from tray" do
post bulk_reading_path
assert_redirected_to notifications_path
end
test "create returns ok when from tray" do
post bulk_reading_path, params: { from_tray: true }
assert_response :ok
end
end