Skip to content
This repository
Browse code

Status code and headers are wrong after redirect

  • Loading branch information...
commit e531c1a715101bcab60549b9051ebeea3a13822f 1 parent cae5119
Matthew Horan authored August 22, 2012

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. 12  spec/driver_spec.rb
12  spec/driver_spec.rb
@@ -143,6 +143,7 @@ def in_iframe_request?
143 143
     let(:driver) do
144 144
       driver_for_app do
145 145
         get '/target' do
  146
+          headers 'X-Redirected' => 'true'
146 147
           "<p>#{env['CONTENT_TYPE']}</p>"
147 148
         end
148 149
 
@@ -187,6 +188,17 @@ def in_iframe_request?
187 188
       driver.execute_script("window.history.replaceState({}, '', '/replaced-after-redirect')")
188 189
       driver.current_url.should == driver_url(driver, "/replaced-after-redirect")
189 190
     end
  191
+
  192
+    it "should make headers available through response_headers" do
  193
+      driver.visit('/redirect-me')
  194
+      driver.response_headers['X-Redirected'].should == "true"
  195
+    end
  196
+
  197
+    it "should make the status code available through status_code" do
  198
+      driver.visit('/redirect-me')
  199
+      driver.status_code.should == 200
  200
+    end
  201
+
190 202
   end
191 203
 
192 204
   context "css app" do

0 notes on commit e531c1a

Please sign in to comment.
Something went wrong with that request. Please try again.