Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Test to verify fix for #39
Browse files Browse the repository at this point in the history
  • Loading branch information
jferris committed Oct 1, 2011
1 parent e746fea commit f3f1e93
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1013,4 +1013,32 @@ def set_automatic_reload(value)
node.text.should == 'Hello'
end
end

context "javascript redirect app" do
before(:all) do
@app = lambda do |env|
if env['PATH_INFO'] == '/redirect'
body = <<-HTML
<html>
<script type="text/javascript">
window.location = "/next";
</script>
</html>
HTML
else
body = "<html><p>finished</p></html>"
end
[200,
{ 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s },
[body]]
end
end

it "loads a page without error" do
10.times do
subject.visit("/redirect")
subject.find("//p").first.text.should == "finished"
end
end
end
end

0 comments on commit f3f1e93

Please sign in to comment.