Add card update & delete actions
This commit is contained in:
@@ -154,4 +154,20 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_equal "Big if true", card.description.to_plain_text
|
||||
assert_equal [ tags(:mobile), tags(:web) ].sort, card.tags.sort
|
||||
end
|
||||
|
||||
test "update as JSON" do
|
||||
card = cards(:logo)
|
||||
put card_path(card, format: :json), params: { card: { title: "Update test" } }
|
||||
|
||||
assert_response :success
|
||||
assert_equal "Update test", card.reload.title
|
||||
end
|
||||
|
||||
test "delete as JSON" do
|
||||
card = cards(:logo)
|
||||
delete card_path(card, format: :json)
|
||||
|
||||
assert_response :no_content
|
||||
assert_not Card.exists?(card.id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user