Module: Capybara::Node::DocumentMatchers
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/capybara/node/document_matchers.rb |
Instance Method Summary
-
#assert_no_title(string, **options) ⇒ true
Asserts that the page doesn’t have the given title.
-
#assert_title(string, **options) ⇒ true
Asserts that the page has the given title.
-
#has_no_title?(string, **options) ⇒ Boolean
Checks if the page doesn’t have the given title.
-
#has_title?(string, **options) ⇒ Boolean
Checks if the page has the given title.
- #_verify_title(title, options) private
Instance Method Details
#_verify_title(title, options) (private)
[ GitHub ]# File 'lib/capybara/node/document_matchers.rb', line 60
def _verify_title(title, ) query = Capybara::Queries::TitleQuery.new(title, ** ) synchronize(query.wait) { yield(query) } true end
#assert_no_title(string, **options) ⇒ true
#assert_no_title(regexp, **options) ⇒ true
true
#assert_no_title(regexp, **options) ⇒ true
Asserts that the page doesn’t have the given title.
# File 'lib/capybara/node/document_matchers.rb', line 32
def assert_no_title(title, ** ) _verify_title(title, ) do |query| raise Capybara::ExpectationNotMet, query. if query.resolves_for?(self) end end
#assert_title(string, **options) ⇒ true
#assert_title(regexp, **options) ⇒ true
true
#assert_title(regexp, **options) ⇒ true
Asserts that the page has the given title.
# File 'lib/capybara/node/document_matchers.rb', line 19
def assert_title(title, ** ) _verify_title(title, ) do |query| raise Capybara::ExpectationNotMet, query. unless query.resolves_for?(self) end end
#has_no_title?(string, **options) ⇒ Boolean
#has_no_title?(regexp, **options) ⇒ Boolean
Boolean
#has_no_title?(regexp, **options) ⇒ Boolean
Checks if the page doesn’t have the given title.
# File 'lib/capybara/node/document_matchers.rb', line 54
def has_no_title?(title, ** ) make_predicate( ) { assert_no_title(title, ** ) } end
#has_title?(string, **options) ⇒ Boolean
#has_title?(regexp, **options) ⇒ Boolean
Boolean
#has_title?(regexp, **options) ⇒ Boolean
Checks if the page has the given title.
# File 'lib/capybara/node/document_matchers.rb', line 44
def has_title?(title, ** ) make_predicate( ) { assert_title(title, ** ) } end