diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 09:44:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 09:44:55 +0000 |
commit | 94cae0d0a24ad683f5fcae6c13600240d0f4c91e (patch) | |
tree | bd41065ccefacca5c15607c01ee032701bb1c855 /actionpack/test | |
parent | 571abe8d5e8bd8df8a891bfb214e129cc97cf4a3 (diff) | |
download | rails-94cae0d0a24ad683f5fcae6c13600240d0f4c91e.tar.gz rails-94cae0d0a24ad683f5fcae6c13600240d0f4c91e.tar.bz2 rails-94cae0d0a24ad683f5fcae6c13600240d0f4c91e.zip |
Got back to functional testing harmony
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index c754db70ed..6a940ee2e4 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -5,6 +5,10 @@ class TestTest < Test::Unit::TestCase def set_flash flash["test"] = ">#{flash["test"]}<" end + + def test_params + render :text => params.inspect + end def test_uri render :text => request.request_uri @@ -88,4 +92,21 @@ HTML def test_assert_routing assert_generates 'controller/action/5', :controller => 'controller', :action => 'action', :id => '5' end + + def test_params_passing + get :test_params, :page => {:name => "Page name", :month => '4', :year => '2004', :day => '6'} + parsed_params = eval(@response.body) + assert_equal( + {'controller' => 'test_test/test', 'action' => 'test_params', + 'page' => {'name' => "Page name", 'month' => '4', 'year' => '2004', 'day' => '6'}}, + parsed_params + ) + end + + def test_path_params_are_strings + get :test_params, :id => 20, :foo => Object.new + @request.path_parameters.each do |key, value| + assert_kind_of String, value + end + end end |