Merge remote branch 'robholland/master'

This commit is contained in:
Jonas Nicklas 2010-06-29 23:30:21 +02:00
commit b79cefbd98
3 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,13 @@ class Capybara::Driver::RackTest < Capybara::Driver::Base
end
end
def value
if tag_name == 'textarea'
node.content
else
super
end
end
def set(value)
if tag_name == 'input' and type == 'radio'

View File

@ -60,6 +60,10 @@ shared_examples_for 'driver' do
@driver.find('//input[@id="checked_field"]')[0][:checked].should be_true
end
it "should allow retrieval of the value" do
@driver.find('//textarea').first.value.should == 'banana'
end
it "should allow assignment of field value" do
@driver.find('//input').first.value.should == 'monkey'
@driver.find('//input').first.set('gorilla')

View File

@ -20,6 +20,7 @@
<p>
<input type="text" id="test_field" value="monkey"/>
<textarea>banana</textarea>
<a href="/redirect_back">BackToMyself</a>
<a title="twas a fine link" href="/redirect">A link came first</a>
<a title="a fine link" href="/with_simple_html">A link</a>