From f2c9734be0e007a2f149b53c291d098d283ac376 Mon Sep 17 00:00:00 2001 From: Timm Date: Thu, 1 Aug 2013 19:26:53 +0200 Subject: Returning from filter if matches are empty. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index c2a5d59577..529db22fff 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -338,7 +338,7 @@ module ActionDispatch def filter(matches) match_with = comparisons[:text] || comparisons[:html] - return matches unless match_with + return matches if matches.empty? || !match_with content_mismatch = nil text_matches = comparisons.has_key?(:text) -- cgit v1.2.3