Test to verify fix for #39

This commit is contained in:
Joe Ferris 2011-10-01 11:49:07 -05:00
parent e746feab5d
commit f3f1e933cd
1 changed files with 28 additions and 0 deletions

View File

@ -1013,4 +1013,32 @@ describe Capybara::Driver::Webkit do
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