Add tests for new controllers
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
require "test_helper"
|
||||
|
||||
class Cards::NotNowsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in_as :kevin
|
||||
end
|
||||
|
||||
test "create" do
|
||||
card = cards(:logo)
|
||||
|
||||
assert_changes -> { card.reload.postponed? }, from: false, to: true do
|
||||
post card_not_now_path(card)
|
||||
assert_card_container_rerendered(card)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,27 @@
|
||||
require "test_helper"
|
||||
|
||||
class Cards::TriagesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in_as :kevin
|
||||
end
|
||||
|
||||
test "create" do
|
||||
card = cards(:logo)
|
||||
original_column = card.column
|
||||
column = columns(:writebook_in_progress)
|
||||
|
||||
assert_changes -> { card.reload.column }, from: original_column, to: column do
|
||||
post card_triage_path(card, column_id: column.id)
|
||||
assert_card_container_rerendered(card)
|
||||
end
|
||||
end
|
||||
|
||||
test "destroy" do
|
||||
card = cards(:shipping)
|
||||
|
||||
assert_changes -> { card.reload.column }, to: nil do
|
||||
delete card_triage_path(card)
|
||||
assert_card_container_rerendered(card)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user