Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 4b50c935be097306bb4a819dbe85aa7333c74499 1 parent 6970e7c
@sikachu sikachu authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 test/webservice_test.rb
  2. +1 −1  test/xml_params_parsing_test.rb
View
4 test/webservice_test.rb
@@ -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
View
2  test/xml_params_parsing_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.