Implement status_code method for rack_test_driver.
This commit is contained in:
parent
072e697130
commit
d80471982d
|
@ -204,6 +204,10 @@ class Capybara::Driver::RackTest < Capybara::Driver::Base
|
|||
def response_headers
|
||||
response.headers
|
||||
end
|
||||
|
||||
def response_code
|
||||
response.status
|
||||
end
|
||||
|
||||
def submit(method, path, attributes)
|
||||
path = current_path if not path or path.empty?
|
||||
|
|
|
@ -133,7 +133,7 @@ end
|
|||
shared_examples_for "driver with response code support" do
|
||||
it "should make the response code available through response_code" do
|
||||
@driver.visit('/with_simple_html')
|
||||
@driver.response_code.should == '200'
|
||||
@driver.response_code.should == 200
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ shared_examples_for "session with response code support" do
|
|||
describe '#response_code' do
|
||||
it "should return response codes" do
|
||||
@session.visit('/with_simple_html')
|
||||
@session.response_code.should == '200'
|
||||
@session.response_code.should == 200
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,6 @@ describe Capybara::Driver::RackTest do
|
|||
|
||||
it_should_behave_like "driver"
|
||||
it_should_behave_like "driver with header support"
|
||||
it_should_behave_like "driver without response code support"
|
||||
it_should_behave_like "driver with response code support"
|
||||
|
||||
end
|
||||
|
|
|
@ -29,6 +29,6 @@ describe Capybara::Session do
|
|||
it_should_behave_like "session"
|
||||
it_should_behave_like "session without javascript support"
|
||||
it_should_behave_like "session with headers support"
|
||||
it_should_behave_like "session without response code support"
|
||||
it_should_behave_like "session with response code support"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue