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

Commit

Permalink
Status code and headers are wrong after redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoran committed Oct 24, 2012
1 parent cae5119 commit e531c1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def in_iframe_request?
let(:driver) do
driver_for_app do
get '/target' do
headers 'X-Redirected' => 'true'
"<p>#{env['CONTENT_TYPE']}</p>"
end

Expand Down Expand Up @@ -187,6 +188,17 @@ def in_iframe_request?
driver.execute_script("window.history.replaceState({}, '', '/replaced-after-redirect')")
driver.current_url.should == driver_url(driver, "/replaced-after-redirect")
end

it "should make headers available through response_headers" do
driver.visit('/redirect-me')
driver.response_headers['X-Redirected'].should == "true"
end

it "should make the status code available through status_code" do
driver.visit('/redirect-me')
driver.status_code.should == 200
end

end

context "css app" do
Expand Down

0 comments on commit e531c1a

Please sign in to comment.