Module: Webrat::HaveTagMatcher

Defined in:
lib/webrat/core/matchers/have_tag.rb

Defined Under Namespace

Classes: HaveTag

Instance Method Summary collapse

Instance Method Details

#assert_have_no_tag(name, attributes = {}) ⇒ Object

Asserts that the body of the response does not contain the supplied string or regepx



65
66
67
68
# File 'lib/webrat/core/matchers/have_tag.rb', line 65

def assert_have_no_tag(name, attributes = {})
  ht = HaveTag.new([name, attributes])
  assert !ht.matches?(response_body), ht.negative_failure_message
end

#assert_have_tag(name, attributes = {}) ⇒ Object

Asserts that the body of the response contains the supplied tag with the associated selectors



58
59
60
61
# File 'lib/webrat/core/matchers/have_tag.rb', line 58

def assert_have_tag(name, attributes = {})
  ht = HaveTag.new([name, attributes])
  assert ht.matches?(response_body), ht.failure_message
end

#have_tag(name, attributes = {}, &block) ⇒ Object Also known as: match_tag



50
51
52
# File 'lib/webrat/core/matchers/have_tag.rb', line 50

def have_tag(name, attributes = {}, &block)
  HaveTag.new([name, attributes], &block)
end