Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added spec for response header

  • Loading branch information...
commit 9c195af89c7e3103306913ed8c61a7af6a8c4ff6 1 parent c28e9a1
@os0x os0x authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 spec/integration/session_spec.rb
View
16 spec/integration/session_spec.rb
@@ -80,7 +80,7 @@
end
end
- context "status code" do
+ context "response headers with status code" do
before(:all) do
@app = lambda do |env|
params = ::Rack::Utils.parse_query(env['QUERY_STRING'])
@@ -96,7 +96,7 @@
</html>
HTML
[200,
- { 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s },
+ { 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s, 'X-Capybara' => 'WebKit'},
[body]]
end
end
@@ -112,6 +112,18 @@
subject.reset!
subject.status_code.should == 0
end
+
+ it "should get response headers" do
+ subject.visit '/'
+ subject.response_headers['X-Capybara'].should == 'WebKit'
+ end
+
+ it "should reset response headers" do
+ subject.visit '/'
+ subject.response_headers['X-Capybara'].should == 'WebKit'
+ subject.reset!
+ subject.response_headers['X-Capybara'].should == nil
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.