Skip to content

Commit

Permalink
Fix broken test from behavior change in Rails 4.0
Browse files Browse the repository at this point in the history
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 4b50c93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/webservice_test.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/xml_params_parsing_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 4b50c93

Please sign in to comment.