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
This commit is contained in:
@@ -21,7 +21,7 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
card = Card.last
|
||||
assert_redirected_to card
|
||||
assert_redirected_to card_draft_path(card)
|
||||
|
||||
assert card.drafted?
|
||||
end
|
||||
@@ -31,10 +31,17 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
assert_no_difference -> { Card.count } do
|
||||
post board_cards_path(boards(:writebook))
|
||||
assert_redirected_to draft
|
||||
assert_redirected_to card_draft_path(draft)
|
||||
end
|
||||
end
|
||||
|
||||
test "show redirects to draft when card is drafted" do
|
||||
card = boards(:writebook).cards.create!(creator: users(:kevin), status: :drafted)
|
||||
|
||||
get card_path(card)
|
||||
assert_redirected_to card_draft_path(card)
|
||||
end
|
||||
|
||||
test "show" do
|
||||
get card_path(cards(:logo))
|
||||
assert_response :success
|
||||
|
||||
Reference in New Issue
Block a user