From 6aea3bc149bf7ae265d335601cf9c173d7792d58 Mon Sep 17 00:00:00 2001 From: Timm Date: Tue, 23 Jul 2013 16:36:15 +0200 Subject: Changed filter_matches to return a new NodeSet instead of Array. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') 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 -- cgit v1.2.3