9d4dd3b00e
Removes the creating status completely as well as the abandoned cards system. It will always resume drafts if they exist, for a given collection and user. https://app.box-car.com/5986089/cards/2489
33 lines
726 B
Ruby
33 lines
726 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.collection
|
|
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
|
|
|
|
assert Card.last.drafted?
|
|
assert_redirected_to Card.last
|
|
end
|
|
end
|