aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/mime_responds_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-05-24 13:12:40 +0200
committerJosé Valim <jose.valim@gmail.com>2010-05-24 13:12:40 +0200
commit59d1c418be47694a5b79d860bced6f9b7f11f3a8 (patch)
treedfdb012846d30dc7c1c57a203903325083426506 /actionpack/test/controller/mime_responds_test.rb
parent69a9669d9d51fae8f591cd7a0108b6fc4b47070c (diff)
downloadrails-59d1c418be47694a5b79d860bced6f9b7f11f3a8.tar.gz
rails-59d1c418be47694a5b79d860bced6f9b7f11f3a8.tar.bz2
rails-59d1c418be47694a5b79d860bced6f9b7f11f3a8.zip
Fix a bug where responders were not working properly on method override.
Diffstat (limited to 'actionpack/test/controller/mime_responds_test.rb')
-rw-r--r--actionpack/test/controller/mime_responds_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb
index c8ba8bcaf3..d654338dba 100644
--- a/actionpack/test/controller/mime_responds_test.rb
+++ b/actionpack/test/controller/mime_responds_test.rb
@@ -668,6 +668,19 @@ class RespondWithControllerTest < ActionController::TestCase
end
end
+ def test_using_resource_for_put_with_html_rerender_on_failure_even_on_method_override
+ with_test_route_set do
+ errors = { :name => :invalid }
+ Customer.any_instance.stubs(:errors).returns(errors)
+ @request.env["rack.methodoverride.original_method"] = "POST"
+ put :using_resource
+ assert_equal "text/html", @response.content_type
+ assert_equal 200, @response.status
+ assert_equal "Edit world!\n", @response.body
+ assert_nil @response.location
+ end
+ end
+
def test_using_resource_for_put_with_xml_yields_ok_on_success
@request.accept = "application/xml"
put :using_resource