Skip to content

Commit

Permalink
fix for thoughtbot#52
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Pytel committed Jun 2, 2011
1 parent e121981 commit 66a6145
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions spec/driver_spec.rb
Expand Up @@ -167,6 +167,11 @@
subject.current_url.should =~ /hello%20there/
end

it "visits a page with an anchor" do
subject.visit("/hello#display_none")
subject.current_url.should =~ /hello#display_none/
end

it "returns the source code for the page" do
subject.source.should =~ %r{<html>.*greeting.*}m
end
Expand Down
8 changes: 6 additions & 2 deletions src/Visit.cpp
Expand Up @@ -7,7 +7,12 @@ Visit::Visit(WebPage *page, QObject *parent) : Command(page, parent) {
}

void Visit::start(QStringList &arguments) {
page()->currentFrame()->setUrl(QUrl(arguments[0]));
QUrl requestedUrl = QUrl(arguments[0]);
page()->currentFrame()->setUrl(QUrl(requestedUrl));
if(requestedUrl.hasFragment()) {
// workaround for https://bugs.webkit.org/show_bug.cgi?id=32723
page()->currentFrame()->setUrl(QUrl(requestedUrl));
}
}

void Visit::loadFinished(bool success) {
Expand All @@ -17,4 +22,3 @@ void Visit::loadFinished(bool success) {

emit finished(new Response(success, message));
}

1 change: 0 additions & 1 deletion src/Visit.h
Expand Up @@ -13,4 +13,3 @@ class Visit : public Command {
void loadFinished(bool success);
};


0 comments on commit 66a6145

Please sign in to comment.