From 9dc221f0b2f3d3cec73578b05a8e32902154865e Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 13 Jun 2025 08:58:06 +0200 Subject: [PATCH] Add test --- test/controllers/cards/publishes_controller_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/controllers/cards/publishes_controller_test.rb b/test/controllers/cards/publishes_controller_test.rb index c9df4d0aa..e5a99c51c 100644 --- a/test/controllers/cards/publishes_controller_test.rb +++ b/test/controllers/cards/publishes_controller_test.rb @@ -15,4 +15,17 @@ class Cards::PublishesControllerTest < ActionDispatch::IntegrationTest assert_redirected_to card end + + test "create and add another" do + card = cards(:logo) + card.drafted! + + assert_changes -> { card.reload.published? }, from: false, to: true do + assert_difference -> { Card.creating.count }, +1 do + post card_publish_path(card, creation_type: "add_another") + end + end + + assert_redirected_to Card.creating.last + end end