提交 b5442b5a 编写于 作者: A Aaron Patterson

test should be testing to_param not to_s, remove Array subclass

上级 e136fbd7
......@@ -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
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册