mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
test fixes
This commit is contained in:
parent
3de215400e
commit
54ca647a1f
3 changed files with 18 additions and 5 deletions
|
@ -20,6 +20,7 @@ module Capybara
|
|||
|
||||
def initialize
|
||||
@session_options = Capybara::SessionConfig.new
|
||||
@javascript_driver = nil
|
||||
end
|
||||
|
||||
attr_writer :reuse_server
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class NodeWrapper
|
||||
def initialize(element); @element = element end
|
||||
def to_capybara_node(); @element end
|
||||
end
|
||||
|
||||
Capybara::SpecHelper.spec "#to_capybara_node" do
|
||||
before do
|
||||
@session.visit('/with_html')
|
||||
end
|
||||
|
||||
class NodeWrapper
|
||||
def initialize(element); @element = element end
|
||||
def to_capybara_node(); @element end
|
||||
end
|
||||
|
||||
it "should support have_xxx expectations" do
|
||||
para = NodeWrapper.new(@session.find(:css, '#first'))
|
||||
expect(para).to have_link("ullamco")
|
||||
|
|
|
@ -18,6 +18,12 @@ RSpec.describe Capybara::Session do
|
|||
end
|
||||
|
||||
context "current_driver" do
|
||||
around do |example|
|
||||
orig_driver = Capybara.current_driver
|
||||
example.run
|
||||
Capybara.current_driver = orig_driver
|
||||
end
|
||||
|
||||
it "is global when threadsafe false" do
|
||||
Capybara.threadsafe = false
|
||||
Capybara.current_driver = :selenium
|
||||
|
@ -40,6 +46,12 @@ RSpec.describe Capybara::Session do
|
|||
end
|
||||
|
||||
context "session_name" do
|
||||
around do |example|
|
||||
orig_name = Capybara.session_name
|
||||
example.run
|
||||
Capybara.session_name = orig_name
|
||||
end
|
||||
|
||||
it "is global when threadsafe false" do
|
||||
Capybara.threadsafe = false
|
||||
Capybara.session_name = "sess1"
|
||||
|
|
Loading…
Add table
Reference in a new issue