Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (38 sloc) 1.177 kb
409c4cd @bernerdschaefer Remove constant redefined warnings in suite
bernerdschaefer authored
1 require 'spec_helper'
eb82466 Capybara#default_wait_time
Lenny Marks authored
2
3 describe Capybara do
95dc635 Reset default_wait_time to correct value after test
Nicklas Ramhöj authored
4
eb82466 Capybara#default_wait_time
Lenny Marks authored
5 describe 'default_wait_time' do
6 after do
95dc635 Reset default_wait_time to correct value after test
Nicklas Ramhöj authored
7 Capybara.default_wait_time = @previous_default_time
eb82466 Capybara#default_wait_time
Lenny Marks authored
8 end
95dc635 Reset default_wait_time to correct value after test
Nicklas Ramhöj authored
9
eb82466 Capybara#default_wait_time
Lenny Marks authored
10 it "should be changeable" do
95dc635 Reset default_wait_time to correct value after test
Nicklas Ramhöj authored
11 @previous_default_time = Capybara.default_wait_time
eb82466 Capybara#default_wait_time
Lenny Marks authored
12 Capybara.default_wait_time = 5
13 Capybara.default_wait_time.should == 5
14 end
15 end
7fc12fd @jnicklas Drivers are now manually registered
jnicklas authored
16
17 describe '.register_driver' do
18 it "should add a new driver" do
19 Capybara.register_driver :schmoo do |app|
fd5996f @jnicklas Fixed some failing stuff
jnicklas authored
20 Capybara::RackTest::Driver.new(app)
7fc12fd @jnicklas Drivers are now manually registered
jnicklas authored
21 end
22 session = Capybara::Session.new(:schmoo, TestApp)
23 session.visit('/')
24 session.body.should include("Hello world!")
25 end
26 end
95dc635 Reset default_wait_time to correct value after test
Nicklas Ramhöj authored
27
91e59f3 Allow the Rack handler to be configured via Capybara.server {|app, po…
John Firebaugh authored
28 describe ".server" do
29 after do
30 Capybara.server {|app, port| Capybara.run_default_server(app, port)}
31 end
32
33 it "should default to a proc that calls run_default_server" do
34 mock_app = mock('app')
35 Capybara.should_receive(:run_default_server).with(mock_app, 8000)
36 Capybara.server.call(mock_app, 8000)
37 end
38
39 it "should return a custom server proc" do
40 server = lambda {|app, port|}
41 Capybara.server(&server)
42 Capybara.server.should == server
43 end
44 end
45
7fc12fd @jnicklas Drivers are now manually registered
jnicklas authored
46 end
Something went wrong with that request. Please try again.