Module: Capybara::Node::DocumentMatchers
Instance Method Summary collapse
-
#assert_no_title(title, **options) ⇒ true
Asserts that the page doesn’t have the given title.
-
#assert_title(title, **options) ⇒ true
Asserts that the page has the given title.
-
#has_no_title?(title, **options) ⇒ Boolean
Checks if the page doesn’t have the given title.
-
#has_title?(title, **options) ⇒ Boolean
Checks if the page has the given title.
Instance Method Details
#assert_no_title(string, **options) ⇒ true #assert_no_title(regexp, **options) ⇒ true
Asserts that the page doesn’t have the given title.
30 31 32 |
# File 'lib/capybara/node/document_matchers.rb', line 30 def assert_no_title(title, **) _verify_title(title, ) { |query| raise Capybara::ExpectationNotMet, query. if query.resolves_for?(self) } end |
#assert_title(string, **options) ⇒ true #assert_title(regexp, **options) ⇒ true
Asserts that the page has the given title.
19 20 21 |
# File 'lib/capybara/node/document_matchers.rb', line 19 def assert_title(title, **) _verify_title(title, ) { |query| raise Capybara::ExpectationNotMet, query. unless query.resolves_for?(self) } end |
#has_no_title?(string, **options) ⇒ Boolean #has_no_title?(regexp, **options) ⇒ Boolean
Checks if the page doesn’t have the given title.
52 53 54 55 56 |
# File 'lib/capybara/node/document_matchers.rb', line 52 def has_no_title?(title, **) assert_no_title(title, ) rescue Capybara::ExpectationNotMet false end |
#has_title?(string, **options) ⇒ Boolean #has_title?(regexp, **options) ⇒ Boolean
Checks if the page has the given title.
40 41 42 43 44 |
# File 'lib/capybara/node/document_matchers.rb', line 40 def has_title?(title, **) assert_title(title, ) rescue Capybara::ExpectationNotMet false end |