aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/test_test.rb21
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