mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
don't raise an exception if the format isn't recognized
Fixed while traveling to heuruko
This commit is contained in:
parent
ee46bb73d4
commit
16571f9c42
2 changed files with 7 additions and 1 deletions
|
@ -19,7 +19,7 @@ module ActionController
|
|||
:controller => self.class.name,
|
||||
:action => self.action_name,
|
||||
:params => request.filtered_parameters,
|
||||
:format => request.format.ref,
|
||||
:format => request.format.try(:ref),
|
||||
:method => request.method,
|
||||
:path => (request.fullpath rescue "unknown")
|
||||
}
|
||||
|
|
|
@ -498,6 +498,12 @@ class RespondToControllerTest < ActionController::TestCase
|
|||
assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
|
||||
assert_equal "text/html", @response.content_type
|
||||
end
|
||||
|
||||
def test_invalid_format
|
||||
get :using_defaults, :format => "invalidformat"
|
||||
assert_equal " ", @response.body
|
||||
assert_equal "text/html", @response.content_type
|
||||
end
|
||||
end
|
||||
|
||||
class RespondWithController < ActionController::Base
|
||||
|
|
Loading…
Reference in a new issue