Use singular staging resource and beef up testing

This commit is contained in:
David Heinemeier Hansson
2025-04-22 14:44:55 +02:00
parent 5ea0ec8cb4
commit 3d28203224
7 changed files with 32 additions and 36 deletions
-14
View File
@@ -25,19 +25,5 @@ class CardMessagesTest < ActionDispatch::IntegrationTest
assert_predicate card.messages.last, :event_summary?
assert_equal 1, card.messages.last.event_summary.events.count
assert_equal "assigned", card.messages.last.messageable.events.last.action
# Stage it
post card_stagings_path(card), params: { stage_id: workflow_stages(:qa_triage).id }
assert_equal 3, card.messages.count
assert_predicate card.messages.last, :event_summary?
assert_equal 2, card.messages.last.event_summary.events.count
assert_equal "staged", card.messages.last.messageable.events.last.action
# Unstage it
post card_stagings_path(card), params: { stage_id: workflow_stages(:qa_triage).id }
assert_equal 3, card.messages.count
assert_predicate card.messages.last, :event_summary?
assert_equal 3, card.messages.last.event_summary.events.count
assert_equal "unstaged", card.messages.last.messageable.events.last.action
end
end