aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-03-22 18:52:03 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-03-22 18:52:03 -0700
commitbcf3a82f939075b4f4d63adc4b103a0cc8b0a76d (patch)
tree0b31e059da70d8dcbb9243fd89b8f634e6a330ed /actionpack
parent9d44b3f886847eee9c70097165863f8e37d3d1d8 (diff)
parent0ebae1dbc59c34f6b5ae87bf96b8848051a0254c (diff)
downloadrails-bcf3a82f939075b4f4d63adc4b103a0cc8b0a76d.tar.gz
rails-bcf3a82f939075b4f4d63adc4b103a0cc8b0a76d.tar.bz2
rails-bcf3a82f939075b4f4d63adc4b103a0cc8b0a76d.zip
Merge pull request #14450 from vlal/vlal-rails
Incorrect values being printed by assert_select.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG.md7
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 59460cbe82..fe5b38d29f 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -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.
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index 3253a3d424..8a128427bf 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -291,7 +291,7 @@ module ActionDispatch
# 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
else
assert_operator matches.size, :>=, min, message if min
assert_operator matches.size, :<=, max, message if max