Skip to content

Instantly share code, notes, and snippets.

@levinalex
Created August 25, 2010 20:48
Show Gist options
  • Save levinalex/550265 to your computer and use it in GitHub Desktop.
Save levinalex/550265 to your computer and use it in GitHub Desktop.
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