Fix crash due to missing partial

This commit is contained in:
Stanko K.R.
2025-12-10 18:47:00 +01:00
parent b0b90cef66
commit 4e092407ab
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
json.partial! "cards/card", card: @card
json.steps @card.steps, partial: "steps/step", as: :step
json.steps @card.steps, partial: "cards/steps/step", as: :step
+7 -2
View File
@@ -134,9 +134,14 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
end
test "show as JSON" do
get card_path(cards(:logo)), as: :json
card = cards(:logo)
card.steps.create!(content: "First step")
card.steps.create!(content: "Second step", completed: true)
get card_path(card), as: :json
assert_response :success
assert_equal cards(:logo).title, @response.parsed_body["title"]
assert_equal card.title, @response.parsed_body["title"]
assert_equal 2, @response.parsed_body["steps"].size
end
test "create as JSON" do