1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/spec/session/rack_test_session_spec.rb
Gareth Townsend d1fc4d6e1a Rename response_code to status_code for consistency.
Update selenium specs to ensure that it raises the Capybara::NotSupportedByDriverError error.
2010-06-07 13:14:40 +10:00

34 lines
991 B
Ruby

require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Session do
context 'with rack test driver' do
before do
@session = Capybara::Session.new(:rack_test, TestApp)
end
describe '#driver' do
it "should be a rack test driver" do
@session.driver.should be_an_instance_of(Capybara::Driver::RackTest)
end
end
describe '#mode' do
it "should remember the mode" do
@session.mode.should == :rack_test
end
end
describe '#click_link' do
it "should use data-method if available" do
@session.visit "/with_html"
@session.click_link "A link with data-method"
@session.body.should == 'The requested object was deleted'
end
end
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 with status code support"
end
end