mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix spec failures
This commit is contained in:
parent
af9dd36704
commit
e5d71977b2
2 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,7 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
|
||||||
|
|
||||||
def value
|
def value
|
||||||
if tag_name == "select" and native.multiple?
|
if tag_name == "select" and native.multiple?
|
||||||
find(".//option[@selected]").map { |n| n.value || n.text }
|
find(".//option[@selected]").map { |n| if n.has_value? then n.value else n.text end }
|
||||||
else
|
else
|
||||||
native.value
|
native.value
|
||||||
end
|
end
|
||||||
|
@ -77,7 +77,9 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
|
||||||
find('./ancestor::select').first
|
find('./ancestor::select').first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_value?
|
||||||
|
native.object.hasAttribute('value')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :app, :rack_server, :options
|
attr_reader :app, :rack_server, :options
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe 'capybara/rspec' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "switches to the javascript driver when giving it as metadata", :js => true do
|
it "switches to the javascript driver when giving it as metadata", :js => true do
|
||||||
Capybara.current_driver.should == :selenium
|
Capybara.current_driver.should == Capybara.javascript_driver
|
||||||
end
|
end
|
||||||
|
|
||||||
it "switches to the given driver when giving it as metadata", :driver => :culerity do
|
it "switches to the given driver when giving it as metadata", :driver => :culerity do
|
||||||
|
|
Loading…
Add table
Reference in a new issue