Permalink
Browse files

Fix broken test from behavior change in Rails 4.0

Rails 4.0 now returns "Bad Request" (400) response on parameters that
fails to parsed as expected.
  • Loading branch information...
sikachu committed Jun 14, 2013
1 parent 6970e7c commit 4b50c935be097306bb4a819dbe85aa7333c74499
Showing with 3 additions and 3 deletions.
  1. +2 −2 test/webservice_test.rb
  2. +1 −1 test/xml_params_parsing_test.rb
View
@@ -120,10 +120,10 @@ def test_post_xml_using_a_disallowed_type_attribute
$stderr = StringIO.new
with_test_route_set do
post '/', '<foo type="symbol">value</foo>', 'CONTENT_TYPE' => 'application/xml'
- assert_response 500
+ assert_response 400
post '/', '<foo type="yaml">value</foo>', 'CONTENT_TYPE' => 'application/xml'
- assert_response 500
+ assert_response 400
end
ensure
$stderr = STDERR
@@ -74,7 +74,7 @@ def assert_parses(expected, xml)
output = StringIO.new
xml = "<person><name>David</name><avatar type='file' name='me.jpg' content_type='image/jpg'>#{::Base64.encode64('ABC')}</avatar></pineapple>"
post "/parse", xml, default_headers.merge('action_dispatch.show_exceptions' => true, 'action_dispatch.logger' => ActiveSupport::Logger.new(output))
- assert_response :error
+ assert_response :bad_request
output.rewind && err = output.read
assert err =~ /Error occurred while parsing request parameters/
end

0 comments on commit 4b50c93

Please sign in to comment.