Correct card URL in comment JSON output

When rendering details of a comment, we were using the card's `id` as
the param for the URL. But card routes use the card's number, not ID.
This commit is contained in:
Kevin McConnell
2026-02-17 17:05:14 +00:00
parent 4b2586769b
commit 4e9773f9f5
2 changed files with 6 additions and 6 deletions
@@ -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