aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-08-17 11:24:40 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:10 +0200
commitbab54e4e529ae4d727fae8209ac60f9b25802680 (patch)
treef9f4a29b775e791ac663f4fbc8077365af75c361 /actionview/lib/action_view
parent62171784fe374d101aa7cfcb0d1e32c89a3629f8 (diff)
downloadrails-bab54e4e529ae4d727fae8209ac60f9b25802680.tar.gz
rails-bab54e4e529ae4d727fae8209ac60f9b25802680.tar.bz2
rails-bab54e4e529ae4d727fae8209ac60f9b25802680.zip
Changed back to =~ or == comparison in HTMLSelector filter.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/testing/assertions/selector.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/testing/assertions/selector.rb b/actionview/lib/action_view/testing/assertions/selector.rb
index fea07b2897..d510ac2904 100644
--- a/actionview/lib/action_view/testing/assertions/selector.rb
+++ b/actionview/lib/action_view/testing/assertions/selector.rb
@@ -333,7 +333,7 @@ module ActionView
content_mismatch = nil
text_matches = equality_tests.has_key?(:text)
- match_with = Regexp.new(match_with.to_s) unless match_with.is_a?(Regexp)
+ regex_matching = match_with.is_a?(Regexp)
remaining = matches.reject do |match|
# Preserve markup with to_s for html elements
@@ -342,7 +342,7 @@ module ActionView
content.strip! unless NO_STRIP.include?(match.name)
content.sub!(/\A\n/, '') if text_matches && match.name == "textarea"
- next if content =~ match_with
+ next if regex_matching ? (content =~ match_with) : (content == match_with)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, content)
true
end