module Capybara::SessionMatchers
def _verify_current_path(path, options)
def _verify_current_path(path, options) query = Capybara::Queries::CurrentPathQuery.new(path, options) document.synchronize(query.wait) do yield(query) end true end
def assert_current_path(path, **options)
-
(true)
-
Raises:
-
(Capybara::ExpectationNotMet)
- if the assertion hasn't succeeded during wait time
Options Hash:
(**options)
-
:wait
(Numeric
) -- Maximum time that Capybara will wait for the current url/path to eq/match given string/regexp argument -
:ignore_query
(Boolean
) -- Whether the query portion of the current url/path should be ignored -
:url
(Boolean
) -- Whether the compare should be done against the full current url or just the path
Parameters:
-
regexp
(Regexp
) -- The regexp that the current 'path' should match to -
string
(String
) -- The string that the current 'path' should equal
Overloads:
-
assert_current_path(regexp, **options)
-
assert_current_path(string, **options)
def assert_current_path(path, **options) _verify_current_path(path, options) { |query| raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self) } end
def assert_no_current_path(path, **options)
-
(true)
-
Raises:
-
(Capybara::ExpectationNotMet)
- if the assertion hasn't succeeded during wait time
def assert_no_current_path(path, **options) _verify_current_path(path, options) { |query| raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self) } end
def has_current_path?(path, **options)
-
(Boolean)
-
def has_current_path?(path, **options) make_predicate(options) { assert_current_path(path, options) } end
def has_no_current_path?(path, **options)
-
(Boolean)
-
def has_no_current_path?(path, **options) make_predicate(options) { assert_no_current_path(path, options) } end
def make_predicate(options)
def make_predicate(options) options[:wait] = 0 unless options.key?(:wait) || config.predicates_wait yield rescue Capybara::ExpectationNotMet false end