2010-09-17 23:56:32 +00:00
|
|
|
require 'spec_helper'
|
2009-11-07 19:44:45 +00:00
|
|
|
|
2009-11-16 21:02:16 +00:00
|
|
|
describe Capybara::Session do
|
2009-11-07 19:44:45 +00:00
|
|
|
context 'with rack test driver' do
|
|
|
|
before do
|
2010-09-07 16:16:19 +00:00
|
|
|
@session = TestSessions::RackTest
|
2009-11-07 19:44:45 +00:00
|
|
|
end
|
2009-12-12 12:33:00 +00:00
|
|
|
|
2009-11-07 19:44:45 +00:00
|
|
|
describe '#driver' do
|
|
|
|
it "should be a rack test driver" do
|
2009-11-16 21:02:16 +00:00
|
|
|
@session.driver.should be_an_instance_of(Capybara::Driver::RackTest)
|
2009-11-07 19:44:45 +00:00
|
|
|
end
|
|
|
|
end
|
2009-12-12 12:33:00 +00:00
|
|
|
|
2009-11-07 19:44:45 +00:00
|
|
|
describe '#mode' do
|
|
|
|
it "should remember the mode" do
|
|
|
|
@session.mode.should == :rack_test
|
|
|
|
end
|
|
|
|
end
|
2009-12-12 12:33:00 +00:00
|
|
|
|
2010-04-09 12:01:17 +00:00
|
|
|
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
|
|
|
|
|
2009-11-07 19:44:45 +00:00
|
|
|
it_should_behave_like "session"
|
2009-12-12 20:56:32 +00:00
|
|
|
it_should_behave_like "session without javascript support"
|
2009-12-18 18:33:36 +00:00
|
|
|
it_should_behave_like "session with headers support"
|
2010-06-07 03:14:40 +00:00
|
|
|
it_should_behave_like "session with status code support"
|
2009-11-07 19:44:45 +00:00
|
|
|
end
|
|
|
|
end
|