diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-07 06:22:19 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-07 06:22:19 +0000 |
commit | 4ab40059b7925f35cddb0f76dba27ea6cd018de7 (patch) | |
tree | 691519981b09dffb76e950c4eb46d5799a73a1ff /actionpack/test/controller | |
parent | bd9a81ca2d34562a140dfe9a6cfecf969a01042c (diff) | |
download | rails-4ab40059b7925f35cddb0f76dba27ea6cd018de7.tar.gz rails-4ab40059b7925f35cddb0f76dba27ea6cd018de7.tar.bz2 rails-4ab40059b7925f35cddb0f76dba27ea6cd018de7.zip |
Added simulation of @request.request_uri in functional tests #1038 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1103 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 28d64c6043..f92e9dae48 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -5,12 +5,21 @@ class TestTest < Test::Unit::TestCase def set_flash flash["test"] = ">#{flash["test"]}<" end + + def test_uri + render_text @request.request_uri + end end def setup @controller = TestController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + ActionController::Routing::Routes.reload + end + + def teardown + ActionController::Routing::Routes.reload end def test_process_without_flash @@ -22,4 +31,20 @@ class TestTest < Test::Unit::TestCase process :set_flash, nil, nil, { "test" => "value" } assert_flash_equal ">value<", "test" end + + def test_process_with_request_uri_with_no_params + process :test_uri + assert_equal @response.body, "/test_test/test/test_uri" + end + + def test_process_with_request_uri_with_params + process :test_uri, :id => 7 + assert_equal @response.body, "/test_test/test/test_uri/7" + end + + def test_process_with_request_uri_with_params_with_explicit_uri + @request.set_REQUEST_URI "/explicit/uri" + process :test_uri, :id => 7 + assert_equal @response.body, "/explicit/uri" + end end |