Fix spec failures

This commit is contained in:
John Firebaugh 2010-12-23 15:36:22 -08:00
parent af9dd36704
commit e5d71977b2
2 changed files with 5 additions and 3 deletions

View File

@ -11,7 +11,7 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
def value
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
native.value
end
@ -77,7 +77,9 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
find('./ancestor::select').first
end
def has_value?
native.object.hasAttribute('value')
end
end
attr_reader :app, :rack_server, :options

View File

@ -32,7 +32,7 @@ describe 'capybara/rspec' do
end
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
it "switches to the given driver when giving it as metadata", :driver => :culerity do