From 9277e72a3ca1009f135b1eb194ff6f3c96a55c1b Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Sun, 22 May 2011 02:47:54 -0400 Subject: Stringify param values in controller tests. This reduces false positives that come from using ints in params in tests, which do not get converted to strings in the tests. In implementations going through rack, they do get converted to strings. - David Chelimsky and Sam Umbach --- actionpack/test/controller/test_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 5896222a0a..899435ff38 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -493,6 +493,16 @@ XML ) end + def test_params_passing_with_fixnums + 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_params_passing_with_frozen_values assert_nothing_raised do get :test_params, :frozen => 'icy'.freeze, :frozens => ['icy'.freeze].freeze -- cgit v1.2.3