Files
fizzy/test/controllers/cards/publishes_controller_test.rb
T
Jorge Manrubia f58a1aeb31 Use a dedicated resource for showing cards in draft mode
Mobile team needs this. Also, this lets us get rid from some conditionals for handling
both modes with a single template.

https://3.basecamp.com/2914079/buckets/44843469/messages/9437287330
2026-01-08 10:40:21 +01:00

34 lines
761 B
Ruby

require "test_helper"
class Cards::PublishesControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "create" do
card = cards(:logo)
card.drafted!
assert_changes -> { card.reload.published? }, from: false, to: true do
post card_publish_path(card)
end
assert_redirected_to card.board
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.count }, +1 do
post card_publish_path(card, creation_type: "add_another")
end
end
new_card = Card.last
assert new_card.drafted?
assert_redirected_to card_draft_path(new_card)
end
end