Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/cards/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def update

respond_to do |format|
format.turbo_stream
format.json { head :no_content }
format.json { render :show }
end
end

Expand Down
9 changes: 9 additions & 0 deletions test/controllers/cards/comments_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading