Fix crash due to missing partial
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user