Skip to content

Commit 0ebae1d

Browse files
committed
Swapped parameters of assert_equal in assert_select
1 parent 9d44b3f commit 0ebae1d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

actionpack/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* Swapped the parameters of assert_equal in `assert_select` so that the
2+
proper values were printed correctly
3+
4+
Fixes #14422.
5+
6+
*Vishal Lal*
7+
18
* The method `shallow?` returns false if the parent resource is a singleton so
29
we need to check if we're not inside a nested scope before copying the :path
310
and :as options to their shallow equivalents.

actionpack/lib/action_dispatch/testing/assertions/selector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def assert_select(*args, &block)
291291
# so is this custom message really needed?
292292
message = message || %(Expected #{count_description(min, max, count)} matching "#{selector.to_s}", found #{matches.size}.)
293293
if count
294-
assert_equal matches.size, count, message
294+
assert_equal count, matches.size, message
295295
else
296296
assert_operator matches.size, :>=, min, message if min
297297
assert_operator matches.size, :<=, max, message if max

0 commit comments

Comments
 (0)