Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Swapped parameters of assert_equal in assert_select

  • Loading branch information...
commit b423eba444274a47b1fa12db71a9f8290f4cd636 1 parent 239c1b3
@vlal vlal authored chancancode committed
7 actionpack/
@@ -1,3 +1,10 @@
+* Swapped the parameters of assert_equal in `assert_select` so that the
+ proper values were printed correctly
+ Fixes #14422.
+ *Vishal Lal*
* The method `shallow?` returns false if the parent resource is a singleton so
we need to check if we're not inside a nested scope before copying the :path
and :as options to their shallow equivalents.
2  actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -291,7 +291,7 @@ def assert_select(*args, &block)
# so is this custom message really needed?
message = message || %(Expected #{count_description(min, max, count)} matching "#{selector.to_s}", found #{matches.size}.)
if count
- assert_equal matches.size, count, message
+ assert_equal count, matches.size, message
assert_operator matches.size, :>=, min, message if min
assert_operator matches.size, :<=, max, message if max
Please sign in to comment.
Something went wrong with that request. Please try again.