2010-04-09 10:41:35 -04:00
|
|
|
shared_examples_for "session with headers support" do
|
|
|
|
describe '#response_headers' do
|
|
|
|
it "should return response headers" do
|
2011-01-21 09:38:26 -05:00
|
|
|
@session.visit('/with_simple_html')
|
|
|
|
@session.response_headers['Content-Type'].should =~ %r(text/html)
|
2010-04-09 10:41:35 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
shared_examples_for "session without headers support" do
|
|
|
|
describe "#response_headers" do
|
|
|
|
before{ @session.visit('/with_simple_html') }
|
|
|
|
it "should raise an error" do
|
|
|
|
running {
|
|
|
|
@session.response_headers
|
|
|
|
}.should raise_error(Capybara::NotSupportedByDriverError)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|