Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Introduce to_param to assert_redirected_to #880

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@948 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 409d56abda45ee380d6a903cbf835e7a770061d8 1 parent 0919dbf
@dhh dhh authored
View
2  actionpack/lib/action_controller/assertions/action_pack_assertions.rb
@@ -137,7 +137,7 @@ def assert_redirected_to(options = {}, message=nil)
if options.is_a?(Symbol)
response.redirected_to == options
else
- options.keys.all? { |k| options[k] == response.redirected_to[k] }
+ options.keys.all? { |k| options[k] == ( response.redirected_to[k].respond_to?(:to_param) ? response.redirected_to[k].to_param : response.redirected_to[k] if response.redirected_to[k] ) }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.