make asserts count for have_tag
This commit is contained in:
parent
e864d56079
commit
47c0b9520f
@ -57,14 +57,14 @@ module Webrat
|
||||
# the supplied tag with the associated selectors
|
||||
def assert_have_tag(name, attributes = {})
|
||||
ht = HaveTag.new([name, attributes])
|
||||
raise Test::Unit::AssertionFailedError.new(ht.failure_message) unless ht.matches?(response_body)
|
||||
assert ht.matches?(response_body), ht.failure_message
|
||||
end
|
||||
|
||||
# Asserts that the body of the response
|
||||
# does not contain the supplied string or regepx
|
||||
def assert_have_no_tag(name, attributes = {})
|
||||
ht = HaveTag.new([name, attributes])
|
||||
raise Test::Unit::AssertionFailedError.new(ht.negative_failure_message) if ht.matches?(response_body)
|
||||
assert !ht.matches?(response_body), ht.negative_failure_message
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user