Add card update & delete actions

This commit is contained in:
Stanko K.R.
2025-12-05 13:36:21 +01:00
parent ae03f2b283
commit 235a94355e
2 changed files with 26 additions and 1 deletions
+16
View File
@@ -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