mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix issue with current path query and regexps
This commit is contained in:
parent
53a8f5717e
commit
d9fca10413
2 changed files with 7 additions and 1 deletions
|
@ -31,7 +31,7 @@ module Capybara
|
|||
end
|
||||
|
||||
if @expected_path.is_a? Regexp
|
||||
@actual_path.match(@expected_path)
|
||||
@actual_path.to_s.match(@expected_path)
|
||||
else
|
||||
::Addressable::URI.parse(@expected_path) == ::Addressable::URI.parse(@actual_path)
|
||||
end
|
||||
|
|
|
@ -13,6 +13,12 @@ Capybara::SpecHelper.spec '#has_current_path?' do
|
|||
expect(@session).not_to have_current_path(/monkey/)
|
||||
end
|
||||
|
||||
it "should not raise an error when non-http" do
|
||||
@session.reset_session!
|
||||
expect(@session.has_current_path?(/monkey/)).to eq false
|
||||
expect(@session.has_current_path?("/with_js")).to eq false
|
||||
end
|
||||
|
||||
it "should handle non-escaped query options" do
|
||||
@session.click_link("Non-escaped query options")
|
||||
expect(@session).to have_current_path("/with_html?options[]=things")
|
||||
|
|
Loading…
Reference in a new issue