Created
August 25, 2010 20:48
-
-
Save levinalex/550265 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RespondWithController < ActionController::Base | |
respond_to :html, :json | |
def using_resource_with_block | |
respond_with(resource) do |format| | |
format.csv { render :text => "CSV" } | |
end | |
end | |
end | |
# Is this really the desired behavior? Shouldn't this return "text/csv"? | |
def test_using_resource_with_block | |
@request.accept = "*/*" | |
get :using_resource_with_block | |
assert_equal "text/html", @response.content_type | |
end | |
# patch: http://github.com/levinalex/rails/tree/change_response_mime_order |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment