diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-19 20:15:51 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-19 20:15:51 -0500 |
commit | 6f530de9443a4e2ab3d193624ff6ecd3c2b06de2 (patch) | |
tree | db67146ae2a6d1117b25d3ba57c8e08fbf83fb83 /actionpack/test/controller/integration_test.rb | |
parent | 5de340e79f1d11973b7c7bbec82f320fc92b9c99 (diff) | |
download | rails-6f530de9443a4e2ab3d193624ff6ecd3c2b06de2.tar.gz rails-6f530de9443a4e2ab3d193624ff6ecd3c2b06de2.tar.bz2 rails-6f530de9443a4e2ab3d193624ff6ecd3c2b06de2.zip |
Test coverage for integration testing with parameters
Diffstat (limited to 'actionpack/test/controller/integration_test.rb')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index b878962df3..a5373912f5 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -259,6 +259,10 @@ class IntegrationProcessTest < ActionController::IntegrationTest end end + def get_with_params + render :text => "foo: #{params[:foo]}", :status => 200 + end + def post render :text => "Created", :status => 201 end @@ -362,6 +366,34 @@ class IntegrationProcessTest < ActionController::IntegrationTest end end + def test_get_with_query_string + with_test_route_set do + get '/get_with_params?foo=bar' + assert_equal '/get_with_params?foo=bar', request.env["REQUEST_URI"] + assert_equal '/get_with_params?foo=bar', request.request_uri + assert_equal nil, request.env["QUERY_STRING"] + assert_equal 'foo=bar', request.query_string + assert_equal 'bar', request.parameters['foo'] + + assert_equal 200, status + assert_equal "foo: bar", response.body + end + end + + def test_get_with_parameters + with_test_route_set do + get '/get_with_params', :foo => "bar" + assert_equal '/get_with_params', request.env["REQUEST_URI"] + assert_equal '/get_with_params', request.request_uri + assert_equal 'foo=bar', request.env["QUERY_STRING"] + assert_equal 'foo=bar', request.query_string + assert_equal 'bar', request.parameters['foo'] + + assert_equal 200, status + assert_equal "foo: bar", response.body + end + end + private def with_test_route_set with_routing do |set| |