diff --git a/app/controllers/cards/comments_controller.rb b/app/controllers/cards/comments_controller.rb index 7aed33c8c8..2243c1bdb4 100644 --- a/app/controllers/cards/comments_controller.rb +++ b/app/controllers/cards/comments_controller.rb @@ -30,7 +30,7 @@ def update respond_to do |format| format.turbo_stream - format.json { head :no_content } + format.json { render :show } end end diff --git a/test/controllers/cards/comments_controller_test.rb b/test/controllers/cards/comments_controller_test.rb index 5cebe22dea..3e311ae203 100644 --- a/test/controllers/cards/comments_controller_test.rb +++ b/test/controllers/cards/comments_controller_test.rb @@ -102,6 +102,10 @@ class Cards::CommentsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_equal "Flat update", comment.reload.body.to_plain_text + + json = @response.parsed_body + assert_equal comment.id, json["id"] + assert_equal "Flat update", json["body"]["plain_text"] end test "update as JSON" do @@ -111,6 +115,11 @@ class Cards::CommentsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_equal "Updated comment", comment.reload.body.to_plain_text + + json = @response.parsed_body + assert_equal comment.id, json["id"] + assert_equal "Updated comment", json["body"]["plain_text"] + assert_equal comment.creator.id, json["creator"]["id"] end test "edit a comment that contains a mention" do