From 94cae0d0a24ad683f5fcae6c13600240d0f4c91e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 29 Jun 2005 09:44:55 +0000 Subject: Got back to functional testing harmony git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/test_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'actionpack/test/controller') 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 -- cgit v1.2.3