diff options
author | David Chelimsky <dchelimsky@gmail.com> | 2011-05-22 02:47:54 -0400 |
---|---|---|
committer | David Chelimsky <dchelimsky@gmail.com> | 2011-05-22 02:47:54 -0400 |
commit | 9277e72a3ca1009f135b1eb194ff6f3c96a55c1b (patch) | |
tree | 91bbab1fccb733422f420f333ab38daf6e98bddc /actionpack/test | |
parent | 82857adc56efd16d22821971fff4c5e24a3c5b55 (diff) | |
download | rails-9277e72a3ca1009f135b1eb194ff6f3c96a55c1b.tar.gz rails-9277e72a3ca1009f135b1eb194ff6f3c96a55c1b.tar.bz2 rails-9277e72a3ca1009f135b1eb194ff6f3c96a55c1b.zip |
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
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |