Allow for multiple notifications to be read

cc @kevinmcconnell
This commit is contained in:
David Heinemeier Hansson
2025-04-17 11:39:05 +02:00
parent 6fd5168c21
commit a5de4863fa
4 changed files with 22 additions and 5 deletions
@@ -5,11 +5,21 @@ class Cards::ReadingsControllerTest < ActionDispatch::IntegrationTest
sign_in_as :kevin
end
test "index" do
test "read one notification on card visit" do
assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: false, to: true do
post card_reading_path(cards(:logo)), as: :turbo_stream
end
assert_response :success
end
test "read multiple notifications on card visit" do
assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: false, to: true do
assert_changes -> { notifications(:logo_assignment_kevin).reload.read? }, from: false, to: true do
post card_reading_path(cards(:logo)), as: :turbo_stream
end
end
assert_response :success
end
end