Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove yaml Proc param parser test #9104

Merged
merged 1 commit into from

2 participants

Brendon Murphy Carlos Antonio da Silva
Brendon Murphy

I don't believe this test is exercising any explicit params_parser
behavior that the other two Proc tests aren't already doing. Given
that we now know it's a bad idea to load user input via YAML.load,
somebody reading this test might get a dangerous idea about building
out a YAML params parser.

Brendon Murphy bemurphy Remove yaml Proc param parser test
I don't believe this test is exercising any explicit params_parser
behavior that the other two Proc tests aren't already doing.  Given
that we now know it's a bad idea to load user input via YAML.load,
somebody reading this test might get a dangerous idea about building
out a YAML params parser.
c302741
Brendon Murphy

I just realized it's possible the test is there to exercise this bit of code, still seems a bit dubious though.

Edit: Though, that test passes if I comment out the referenced line so, probably not.

Carlos Antonio da Silva carlosantoniodasilva merged commit 29000a7 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 29, 2013
  1. Brendon Murphy

    Remove yaml Proc param parser test

    bemurphy authored
    I don't believe this test is exercising any explicit params_parser
    behavior that the other two Proc tests aren't already doing.  Given
    that we now know it's a bad idea to load user input via YAML.load,
    somebody reading this test might get a dangerous idea about building
    out a YAML params parser.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 13 deletions.
  1. +0 −13 actionpack/test/controller/webservice_test.rb
13 actionpack/test/controller/webservice_test.rb
View
@@ -129,19 +129,6 @@ def test_post_xml_using_a_disallowed_type_attribute
$stderr = STDERR
end
- def test_register_and_use_yaml
- with_test_route_set do
- with_params_parsers Mime::YAML => Proc.new { |d| YAML.load(d) } do
- post "/", {"entry" => "loaded from yaml"}.to_yaml,
- {'CONTENT_TYPE' => 'application/x-yaml'}
-
- assert_equal 'entry', @controller.response.body
- assert @controller.params.has_key?(:entry)
- assert_equal 'loaded from yaml', @controller.params["entry"]
- end
- end
- end
-
def test_register_and_use_xml_simple
with_test_route_set do
with_params_parsers Mime::XML => Proc.new { |data| Hash.from_xml(data)['request'].with_indifferent_access } do
Something went wrong with that request. Please try again.