Skip to content

Commit

Permalink
added spec for response header
Browse files Browse the repository at this point in the history
  • Loading branch information
os0x committed Aug 26, 2011
1 parent c28e9a1 commit 9c195af
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec/integration/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 9c195af

Please sign in to comment.