mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Status code and headers are wrong after redirect
This commit is contained in:
parent
cae5119eef
commit
e531c1a715
1 changed files with 12 additions and 0 deletions
|
@ -143,6 +143,7 @@ describe Capybara::Webkit::Driver do
|
||||||
let(:driver) do
|
let(:driver) do
|
||||||
driver_for_app do
|
driver_for_app do
|
||||||
get '/target' do
|
get '/target' do
|
||||||
|
headers 'X-Redirected' => 'true'
|
||||||
"<p>#{env['CONTENT_TYPE']}</p>"
|
"<p>#{env['CONTENT_TYPE']}</p>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -187,6 +188,17 @@ describe Capybara::Webkit::Driver do
|
||||||
driver.execute_script("window.history.replaceState({}, '', '/replaced-after-redirect')")
|
driver.execute_script("window.history.replaceState({}, '', '/replaced-after-redirect')")
|
||||||
driver.current_url.should == driver_url(driver, "/replaced-after-redirect")
|
driver.current_url.should == driver_url(driver, "/replaced-after-redirect")
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "css app" do
|
context "css app" do
|
||||||
|
|
Loading…
Reference in a new issue