Permalink
Browse files

test should be testing to_param not to_s, remove Array subclass

  • Loading branch information...
1 parent e136fbd commit b5442b5a3aba2c1e9c3c54c4ec824595536b8f6c @tenderlove tenderlove committed Jul 3, 2012
Showing with 3 additions and 7 deletions.
  1. +1 −5 actionpack/lib/action_controller/test_case.rb
  2. +2 −2 actionpack/test/controller/test_case_test.rb
@@ -150,10 +150,6 @@ def initialize(env = {})
self.session_options = TestSession::DEFAULT_OPTIONS.merge(:id => SecureRandom.hex(16))
end
- class Result < ::Array #:nodoc:
- def to_s() join '/' end
- end
-
def assign_parameters(routes, controller_path, action, parameters = {})
parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action)
extra_keys = routes.extra_keys(parameters)
@@ -171,7 +167,7 @@ def assign_parameters(routes, controller_path, action, parameters = {})
non_path_parameters[key] = value
else
if value.is_a?(Array)
- value = Result.new(value.map(&:to_param))
+ value = value.map(&:to_param)
else
value = value.to_param
end
@@ -635,7 +635,7 @@ def test_array_path_parameter_handled_properly
get :test_params, :path => ['hello', 'world']
assert_equal ['hello', 'world'], @request.path_parameters['path']
- assert_equal 'hello/world', @request.path_parameters['path'].to_s
+ assert_equal 'hello/world', @request.path_parameters['path'].to_param
end
end
@@ -913,4 +913,4 @@ def test_controller_name
get :index
assert_equal 'anonymous', @response.body
end
-end
+end

0 comments on commit b5442b5

Please sign in to comment.