Permalink
Browse files

Fix broken pushState specs from Sinatra refactor

  • Loading branch information...
1 parent af26bab commit 13518d9de7ee08a2be3db48465780d56ccc03d44 @mhoran mhoran committed Aug 23, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 spec/driver_spec.rb
View
@@ -152,6 +152,10 @@ def in_iframe_request?
post '/redirect' do
redirect '/target'
end
+
+ get '/redirect-me' do
+ redirect '/target'
+ end
end
end
@@ -163,12 +167,14 @@ def in_iframe_request?
it "returns the current URL when changed by pushState after a redirect" do
driver.visit("/redirect-me")
+ driver.current_url.should == driver_url(driver, "/target")
driver.execute_script("window.history.pushState({}, '', '/pushed-after-redirect')")
driver.current_url.should == driver_url(driver, "/pushed-after-redirect")
end
it "returns the current URL when changed by replaceState after a redirect" do
driver.visit("/redirect-me")
+ driver.current_url.should == driver_url(driver, "/target")
driver.execute_script("window.history.replaceState({}, '', '/replaced-after-redirect')")
driver.current_url.should == driver_url(driver, "/replaced-after-redirect")
end

0 comments on commit 13518d9

Please sign in to comment.