diff options
author | Timm <kaspth@gmail.com> | 2013-07-23 16:36:15 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-15 23:41:07 +0200 |
commit | 6aea3bc149bf7ae265d335601cf9c173d7792d58 (patch) | |
tree | 29b10da7a2daef25cff621da69c5e13a2e448638 /actionpack/lib/action_dispatch | |
parent | 37ff080ca452160fb36b3a0df2d0b50995e4c801 (diff) | |
download | rails-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/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 3 |
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 |