Module Webrat::Selenium::Matchers

  1. lib/webrat/selenium/matchers/have_content.rb (view online)
  2. lib/webrat/selenium/matchers/have_selector.rb (view online)
  3. lib/webrat/selenium/matchers/have_tag.rb (view online)
  4. lib/webrat/selenium/matchers/have_xpath.rb (view online)
  5. show all

Public instance methods

assert_contain (content)

Asserts that the body of the response contain the supplied string or regexp

[show source]
# File lib/webrat/selenium/matchers/have_content.rb, line 53
      def assert_contain(content)
        hc = HasContent.new(content)
       assert hc.matches?(response), hc.failure_message
      end
assert_have_no_selector (expected)

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

[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 43
      def assert_have_no_selector(expected)
        hs = HaveSelector.new(expected)
        assert !hs.matches?(response), hs.negative_failure_message
      end
assert_have_no_tag (name, attributes = {})

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

[show source]
# File lib/webrat/selenium/matchers/have_tag.rb, line 65
      def assert_have_no_tag(name, attributes = {})
        ht = HaveTag.new([name, attributes])
        assert !ht.matches?(response), ht.negative_failure_message
      end
assert_have_no_xpath (expected)
[show source]
# File lib/webrat/selenium/matchers/have_xpath.rb, line 39
      def assert_have_no_xpath(expected)
        hs = HaveXpath.new(expected)
        assert !hs.matches?(response), hs.negative_failure_message
      end
assert_have_selector (expected)

Asserts that the body of the response contains the supplied selector

[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 36
      def assert_have_selector(expected)
        hs = HaveSelector.new(expected)
        assert hs.matches?(response), hs.failure_message
      end
assert_have_tag (name, attributes = {})

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

[show source]
# File lib/webrat/selenium/matchers/have_tag.rb, line 58
      def assert_have_tag(name, attributes = {})
        ht = HaveTag.new([name, attributes])
        assert ht.matches?(response), ht.failure_message
      end
assert_have_xpath (expected)
[show source]
# File lib/webrat/selenium/matchers/have_xpath.rb, line 34
      def assert_have_xpath(expected)
        hs = HaveXpath.new(expected)
        assert hs.matches?(response), hs.failure_message
      end
assert_not_contain (content)

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

[show source]
# File lib/webrat/selenium/matchers/have_content.rb, line 60
      def assert_not_contain(content)
        hc = HasContent.new(content)
        assert !hc.matches?(response), hc.negative_failure_message
      end
contain (content)

Matches the contents of an HTML document with whatever string is supplied

[show source]
# File lib/webrat/selenium/matchers/have_content.rb, line 47
      def contain(content)
        HasContent.new(content)
      end
have_selector (content)
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 30
      def have_selector(content)
        HaveSelector.new(content)
      end
have_tag (name, attributes = {}, &block)
[show source]
# File lib/webrat/selenium/matchers/have_tag.rb, line 50
      def have_tag(name, attributes = {}, &block)
        HaveTag.new([name, attributes], &block)
      end
have_xpath (xpath)
[show source]
# File lib/webrat/selenium/matchers/have_xpath.rb, line 30
      def have_xpath(xpath)
        HaveXpath.new(xpath)
      end
match_tag (name, attributes = {}, &block)

Alias for have_tag