aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-07-23 16:36:15 +0200
committerTimm <kaspth@gmail.com>2014-06-15 23:41:07 +0200
commit6aea3bc149bf7ae265d335601cf9c173d7792d58 (patch)
tree29b10da7a2daef25cff621da69c5e13a2e448638 /actionpack/lib
parent37ff080ca452160fb36b3a0df2d0b50995e4c801 (diff)
downloadrails-6aea3bc149bf7ae265d335601cf9c173d7792d58.tar.gz
rails-6aea3bc149bf7ae265d335601cf9c173d7792d58.tar.bz2
rails-6aea3bc149bf7ae265d335601cf9c173d7792d58.zip
Changed filter_matches to return a new NodeSet instead of Array.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index 02f59e3db3..ff7b611228 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -298,7 +298,7 @@ module ActionDispatch
return matches unless match_with
text_matches = options.has_key?(:text)
- matches.reject do |match|
+ remaining = matches.reject do |match|
# Preserve html markup with to_s if not matching text elements
content = text_matches ? match.text : match.to_s
@@ -310,6 +310,7 @@ module ActionDispatch
true
end
end
+ Nokogiri::XML::NodeSet.new(matches.document, remaining)
end
# +equals+ must contain :minimum, :maximum and :count keys