diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-01-09 15:43:32 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-09 15:43:32 -0600 |
commit | 38a723e6ea770eb8a902ee85ef40f6a22e7cd1b8 (patch) | |
tree | 884b212b80e2de484e2041992eb8d6fdb773b442 /actionpack/test/controller/request_test.rb | |
parent | ac4bf1180aa0f82616038522bddaf3ff3d5020c8 (diff) | |
download | rails-38a723e6ea770eb8a902ee85ef40f6a22e7cd1b8.tar.gz rails-38a723e6ea770eb8a902ee85ef40f6a22e7cd1b8.tar.bz2 rails-38a723e6ea770eb8a902ee85ef40f6a22e7cd1b8.zip |
Refactor request json params parsing tests
Diffstat (limited to 'actionpack/test/controller/request_test.rb')
-rw-r--r-- | actionpack/test/controller/request_test.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 64cc3f5291..2eb2693644 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -764,25 +764,3 @@ class LegacyXmlParamsParsingTest < XmlParamsParsingTest ActionController::Request.new(env).request_parameters end end - -class JsonParamsParsingTest < ActiveSupport::TestCase - def test_hash_params_for_application_json - person = parse_body({:person => {:name => "David"}}.to_json,'application/json')[:person] - assert_kind_of Hash, person - assert_equal 'David', person['name'] - end - - def test_hash_params_for_application_jsonrequest - person = parse_body({:person => {:name => "David"}}.to_json,'application/jsonrequest')[:person] - assert_kind_of Hash, person - assert_equal 'David', person['name'] - end - - private - def parse_body(body,content_type) - env = { 'rack.input' => StringIO.new(body), - 'CONTENT_TYPE' => content_type, - 'CONTENT_LENGTH' => body.size.to_s } - ActionController::Request.new(env).request_parameters - end -end |