From 7f65bccb096bca870197a0e11521d016b077d750 Mon Sep 17 00:00:00 2001 From: Pavel Gabriel Date: Wed, 9 Sep 2009 12:15:54 +0300 Subject: [PATCH] Fixed Bignum request params in test are converted to string --- .../lib/action_controller/testing/process.rb | 2 +- actionpack/test/controller/test_test.rb | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb index 2fccf01..f359a5b 100644 --- a/actionpack/lib/action_controller/testing/process.rb +++ b/actionpack/lib/action_controller/testing/process.rb @@ -16,7 +16,7 @@ module ActionController #:nodoc: extra_keys = ActionController::Routing::Routes.extra_keys(parameters) non_path_parameters = get? ? query_parameters : request_parameters parameters.each do |key, value| - if value.is_a? Fixnum + if value.is_a? Integer value = value.to_s elsif value.is_a? Array value = ActionController::Routing::PathSegment::Result.new(value) diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 73870a5..c68023e 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -443,9 +443,13 @@ XML ) end - def test_id_converted_to_string - get :test_params, :id => 20, :foo => Object.new - assert_kind_of String, @request.path_parameters['id'] + def test_numeric_id_converted_to_string + [ 20, # Fixnum + 9999999999999999999 # Bignum + ].each do |id| + get :test_params, :id => id, :foo => Object.new + assert_kind_of String, @request.path_parameters['id'] + end end def test_array_path_parameter_handled_properly -- 1.6.4