diff --git a/app/views/cards/comments/_comment.json.jbuilder b/app/views/cards/comments/_comment.json.jbuilder index eaf1805d6..58e2f6290 100644 --- a/app/views/cards/comments/_comment.json.jbuilder +++ b/app/views/cards/comments/_comment.json.jbuilder @@ -13,9 +13,9 @@ json.cache! comment do json.card do json.id comment.card_id - json.url card_url(comment.card_id) + json.url card_url(comment.card) end - json.reactions_url card_comment_reactions_url(comment.card_id, comment.id) - json.url card_comment_url(comment.card_id, comment.id) + json.reactions_url card_comment_reactions_url(comment.card, comment) + json.url card_comment_url(comment.card, comment) end diff --git a/test/controllers/cards/comments_controller_test.rb b/test/controllers/cards/comments_controller_test.rb index 26761d22e..a6e83cbef 100644 --- a/test/controllers/cards/comments_controller_test.rb +++ b/test/controllers/cards/comments_controller_test.rb @@ -78,9 +78,9 @@ class Cards::CommentsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_equal comment.id, @response.parsed_body["id"] assert_equal comment.card.id, @response.parsed_body.dig("card", "id") - assert_equal card_url(comment.card.id), @response.parsed_body.dig("card", "url") - assert_equal card_comment_reactions_url(comment.card_id, comment.id), @response.parsed_body["reactions_url"] - assert_equal card_comment_url(comment.card_id, comment.id), @response.parsed_body["url"] + assert_equal card_url(comment.card), @response.parsed_body.dig("card", "url") + assert_equal card_comment_reactions_url(comment.card, comment), @response.parsed_body["reactions_url"] + assert_equal card_comment_url(comment.card, comment), @response.parsed_body["url"] end test "update as JSON" do