diff options
author | Timm <kaspth@gmail.com> | 2013-08-17 11:24:40 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:10 +0200 |
commit | bab54e4e529ae4d727fae8209ac60f9b25802680 (patch) | |
tree | f9f4a29b775e791ac663f4fbc8077365af75c361 /actionview | |
parent | 62171784fe374d101aa7cfcb0d1e32c89a3629f8 (diff) | |
download | rails-bab54e4e529ae4d727fae8209ac60f9b25802680.tar.gz rails-bab54e4e529ae4d727fae8209ac60f9b25802680.tar.bz2 rails-bab54e4e529ae4d727fae8209ac60f9b25802680.zip |
Changed back to =~ or == comparison in HTMLSelector filter.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/testing/assertions/selector.rb | 4 |
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 |