1959e15f7e
These are mainly because the fixture's UUIDs are deterministic rather than time-sortable, and more places where we need to correct the fixture IDs as well.
34 lines
770 B
Ruby
34 lines
770 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.order(created_at: :desc).first
|
|
assert new_card.drafted?
|
|
assert_redirected_to new_card
|
|
end
|
|
end
|