mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Attempt to visit URLs with invalid characters
* Fixes issues with URLs which include square brackets
This commit is contained in:
parent
0cffabde39
commit
525a8bb130
2 changed files with 7 additions and 1 deletions
|
@ -424,6 +424,12 @@ describe Capybara::Webkit::Driver do
|
||||||
driver.current_url.should =~ /success=\%25true/
|
driver.current_url.should =~ /success=\%25true/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns the current URL with encoded characters" do
|
||||||
|
visit("/hello/world?success[value]=true")
|
||||||
|
current_url = Rack::Utils.unescape(driver.current_url)
|
||||||
|
current_url.should include('success[value]=true')
|
||||||
|
end
|
||||||
|
|
||||||
it "visits a page with an anchor" do
|
it "visits a page with an anchor" do
|
||||||
visit("/hello#display_none")
|
visit("/hello#display_none")
|
||||||
driver.current_url.should =~ /hello#display_none/
|
driver.current_url.should =~ /hello#display_none/
|
||||||
|
|
|
@ -7,7 +7,7 @@ Visit::Visit(WebPageManager *manager, QStringList &arguments, QObject *parent) :
|
||||||
}
|
}
|
||||||
|
|
||||||
void Visit::start() {
|
void Visit::start() {
|
||||||
QUrl requestedUrl = QUrl::fromEncoded(arguments()[0].toUtf8(), QUrl::StrictMode);
|
QUrl requestedUrl = QUrl::fromEncoded(arguments()[0].toUtf8(), QUrl::TolerantMode);
|
||||||
page()->currentFrame()->load(QUrl(requestedUrl));
|
page()->currentFrame()->load(QUrl(requestedUrl));
|
||||||
finish(true);
|
finish(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue