Fix issue with current path query and regexps
This commit is contained in:
parent
53a8f5717e
commit
d9fca10413
|
@ -31,7 +31,7 @@ module Capybara
|
||||||
end
|
end
|
||||||
|
|
||||||
if @expected_path.is_a? Regexp
|
if @expected_path.is_a? Regexp
|
||||||
@actual_path.match(@expected_path)
|
@actual_path.to_s.match(@expected_path)
|
||||||
else
|
else
|
||||||
::Addressable::URI.parse(@expected_path) == ::Addressable::URI.parse(@actual_path)
|
::Addressable::URI.parse(@expected_path) == ::Addressable::URI.parse(@actual_path)
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,12 @@ Capybara::SpecHelper.spec '#has_current_path?' do
|
||||||
expect(@session).not_to have_current_path(/monkey/)
|
expect(@session).not_to have_current_path(/monkey/)
|
||||||
end
|
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
|
it "should handle non-escaped query options" do
|
||||||
@session.click_link("Non-escaped query options")
|
@session.click_link("Non-escaped query options")
|
||||||
expect(@session).to have_current_path("/with_html?options[]=things")
|
expect(@session).to have_current_path("/with_html?options[]=things")
|
||||||
|
|
Loading…
Reference in New Issue