Asserts that the body of the response contain the supplied string or regexp
# File lib/webrat/core/matchers/have_content.rb, line 55 def assert_contain(content) hc = HasContent.new(content) assert hc.matches?(response_body), hc.failure_message end
Asserts that the body of the response does not contain the supplied string or regepx
# File lib/webrat/core/matchers/have_selector.rb, line 68 def assert_have_no_selector(name, attributes = {}, &block) matcher = HaveSelector.new(name, attributes, &block) assert !matcher.matches?(response_body), matcher.negative_failure_message end
# File lib/webrat/core/matchers/have_xpath.rb, line 118 def assert_have_no_xpath(expected, options = {}, &block) hs = HaveXpath.new(expected, options, &block) assert !hs.matches?(response_body), hs.negative_failure_message end
Asserts that the body of the response contains the supplied selector
# File lib/webrat/core/matchers/have_selector.rb, line 61 def assert_have_selector(name, attributes = {}, &block) matcher = HaveSelector.new(name, attributes, &block) assert matcher.matches?(response_body), matcher.failure_message end
# File lib/webrat/core/matchers/have_xpath.rb, line 113 def assert_have_xpath(expected, options = {}, &block) hs = HaveXpath.new(expected, options, &block) assert hs.matches?(response_body), hs.failure_message end
Asserts that the body of the response does not contain the supplied string or regepx
# File lib/webrat/core/matchers/have_content.rb, line 62 def assert_not_contain(content) hc = HasContent.new(content) assert !hc.matches?(response_body), hc.negative_failure_message end
Matches the contents of an HTML document with whatever string is supplied
# File lib/webrat/core/matchers/have_content.rb, line 49 def contain(content) HasContent.new(content) end
Matches HTML content against a CSS 3 selector.
expected<String> |
The CSS selector to look for. |
HaveSelector |
A new have selector matcher. |
# File lib/webrat/core/matchers/have_selector.rb, line 53 def have_selector(name, attributes = {}, &block) HaveSelector.new(name, attributes, &block) end
Matches HTML content against an XPath query
expected<String> |
The XPath query to look for. |
HaveXpath |
A new have xpath matcher. |
# File lib/webrat/core/matchers/have_xpath.rb, line 108 def have_xpath(expected, options = {}, &block) HaveXpath.new(expected, options, &block) end
Generated with the Darkfish Rdoc Generator 2.