Skip to content

Commit

Permalink
Make sure the template being rendered matches the media type
Browse files Browse the repository at this point in the history
After
rails/rails@1bc0a59
Rails will use the media type of the rendered response. So we need to
make sure the rendered response is using the media type we want.
  • Loading branch information
rafaelfranca committed Jun 21, 2019
1 parent eabbd11 commit a649df5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/action_controller/respond_with_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def using_hash_resource

def using_resource_with_block
respond_with(resource) do |format|
format.csv { render :body => "CSV" }
format.csv { render :body => "CSV", content_type: 'text/csv' }
end
end

def using_resource_with_overwrite_block
respond_with(resource) do |format|
format.html { render :body => "HTML" }
format.html { render :html => "HTML" }
end
end

Expand Down

0 comments on commit a649df5

Please # to comment.