Add API for gilding cards

This commit is contained in:
Stanko K.R.
2025-12-05 14:37:04 +01:00
parent 41115eaf87
commit 1caeea541d
2 changed files with 32 additions and 2 deletions
@@ -18,4 +18,26 @@ class Cards::GoldnessesControllerTest < ActionDispatch::IntegrationTest
assert_card_container_rerendered(cards(:logo))
end
end
test "create as JSON" do
card = cards(:text)
assert_not card.golden?
post card_goldness_path(card), as: :json
assert_response :no_content
assert card.reload.golden?
end
test "destroy as JSON" do
card = cards(:logo)
assert card.golden?
delete card_goldness_path(card), as: :json
assert_response :no_content
assert_not card.reload.golden?
end
end