Skip to content

Commit

Permalink
Changed conditional check in filter. Removed weird comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspth committed Jun 16, 2014
1 parent 4b55c0a commit e600b3a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions actionview/lib/action_view/testing/assertions/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,12 @@ def filter(matches)
content.strip! unless NO_STRIP.include?(match.name)
content.sub!(/\A\n/, '') if text_matches && match.name == "textarea"

unless match_with.is_a?(Regexp) ? (content =~ match_with) : (content == match_with.to_s)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, content)
true
end
next if match_with.is_a?(Regexp) ? (content =~ match_with) : (content == match_with.to_s)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, content)
true
end

# Expecting foo found bar element only if found zero, not if
# found one but expecting two.
self.message ||= content_mismatch if remaining.empty?

Nokogiri::XML::NodeSet.new(matches.document, remaining)
end

Expand Down

0 comments on commit e600b3a

Please sign in to comment.