Run driver spec as remote instead

Running session spec is too slow
This commit is contained in:
Jonas Nicklas 2009-12-19 12:40:08 +01:00
parent d8c8cd6bfb
commit b57efde45c
4 changed files with 37 additions and 66 deletions

View File

@ -0,0 +1,19 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Driver::Culerity do
before do
@driver = Capybara::Driver::Culerity.new(TestApp)
end
before(:all) do
Capybara.app_host = "http://capybara-testapp.heroku.com"
end
after(:all) do
Capybara.app_host = nil
end
it_should_behave_like "driver"
it_should_behave_like "driver with javascript support"
it_should_behave_like "driver with header support"
end

View File

@ -0,0 +1,18 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Driver::Selenium do
before(:all) do
Capybara.app_host = "http://capybara-testapp.heroku.com"
end
after(:all) do
Capybara.app_host = nil
end
before do
@driver = Capybara::Driver::Selenium.new(TestApp)
end
it_should_behave_like "driver"
it_should_behave_like "driver with javascript support"
end

View File

@ -1,33 +0,0 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Session do
context 'with culerity driver' do
before(:all) do
Capybara.app_host = "http://capybara-testapp.heroku.com"
end
after(:all) do
Capybara.app_host = nil
end
before do
@session = Capybara::Session.new(:culerity, TestApp)
end
describe '#driver' do
it "should be a rack test driver" do
@session.driver.should be_an_instance_of(Capybara::Driver::Culerity)
end
end
describe '#mode' do
it "should remember the mode" do
@session.mode.should == :culerity
end
end
it_should_behave_like "session"
it_should_behave_like "session with javascript support"
it_should_behave_like "session with headers support"
end
end

View File

@ -1,33 +0,0 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Session do
context 'with selenium driver on a remote host' do
before(:all) do
Capybara.app_host = "http://capybara-testapp.heroku.com"
end
after(:all) do
Capybara.app_host = nil
end
before do
@session = Capybara::Session.new(:selenium, TestApp)
end
describe '#driver' do
it "should be a selenium driver" do
@session.driver.should be_an_instance_of(Capybara::Driver::Selenium)
end
end
describe '#mode' do
it "should remember the mode" do
@session.mode.should == :selenium
end
end
it_should_behave_like "session"
it_should_behave_like "session with javascript support"
it_should_behave_like "session without headers support"
end
end