mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Set Capybara.app at spec run time, not at definition time
This bug got triggered on Travis.
This commit is contained in:
parent
363b43acb7
commit
9fd6c85949
4 changed files with 11 additions and 10 deletions
|
@ -1,9 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'capybara/dsl'
|
require 'capybara/dsl'
|
||||||
|
|
||||||
describe Capybara::DSL do
|
describe Capybara::DSL do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Capybara.app = TestApp
|
Capybara.app = TestApp
|
||||||
end
|
end
|
||||||
|
@ -257,5 +255,4 @@ describe Capybara::DSL do
|
||||||
foo.using_wait_time(6)
|
foo.using_wait_time(6)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'capybara/rspec'
|
require 'capybara/rspec'
|
||||||
|
|
||||||
Capybara.app = TestApp
|
|
||||||
|
|
||||||
RSpec.configuration.before(:each, :example_group => {:file_path => __FILE__}) do
|
RSpec.configuration.before(:each, :example_group => {:file_path => __FILE__}) do
|
||||||
@in_filtered_hook = true
|
@in_filtered_hook = true
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Capybara's feature DSL" do
|
feature "Capybara's feature DSL" do
|
||||||
background do
|
background do
|
||||||
|
Capybara.app = TestApp
|
||||||
@in_background = true
|
@in_background = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,14 @@ require 'spec_helper'
|
||||||
require 'capybara/dsl'
|
require 'capybara/dsl'
|
||||||
require 'capybara/rspec/matchers'
|
require 'capybara/rspec/matchers'
|
||||||
|
|
||||||
Capybara.app = TestApp
|
|
||||||
|
|
||||||
describe Capybara::RSpecMatchers do
|
describe Capybara::RSpecMatchers do
|
||||||
include Capybara::DSL
|
include Capybara::DSL
|
||||||
include Capybara::RSpecMatchers
|
include Capybara::RSpecMatchers
|
||||||
|
|
||||||
|
before :each do
|
||||||
|
Capybara.app = TestApp
|
||||||
|
end
|
||||||
|
|
||||||
describe "have_css matcher" do
|
describe "have_css matcher" do
|
||||||
it "gives proper description" do
|
it "gives proper description" do
|
||||||
have_css('h1').description.should == "has css \"h1\""
|
have_css('h1').description.should == "has css \"h1\""
|
||||||
|
@ -564,4 +566,3 @@ describe Capybara::RSpecMatchers do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
Capybara.app = TestApp
|
|
||||||
|
|
||||||
describe 'capybara/rspec', :type => :request do
|
describe 'capybara/rspec', :type => :request do
|
||||||
|
before :each do
|
||||||
|
Capybara.app = TestApp
|
||||||
|
end
|
||||||
|
|
||||||
it "should include Capybara in rspec" do
|
it "should include Capybara in rspec" do
|
||||||
visit('/foo')
|
visit('/foo')
|
||||||
page.body.should include('Another World')
|
page.body.should include('Another World')
|
||||||
|
@ -41,12 +43,14 @@ end
|
||||||
|
|
||||||
describe 'capybara/rspec', :type => :other do
|
describe 'capybara/rspec', :type => :other do
|
||||||
it "should not include Capybara" do
|
it "should not include Capybara" do
|
||||||
|
Capybara.app = TestApp
|
||||||
expect { visit('/') }.to raise_error(NoMethodError)
|
expect { visit('/') }.to raise_error(NoMethodError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Feature DSL" do
|
feature "Feature DSL" do
|
||||||
scenario "is pulled in" do
|
scenario "is pulled in" do
|
||||||
|
Capybara.app = TestApp
|
||||||
visit('/foo')
|
visit('/foo')
|
||||||
page.body.should include('Another World')
|
page.body.should include('Another World')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue