Permalink
Browse files

Spec boolean attributes

  • Loading branch information...
1 parent b4de9b7 commit 95a63f8d30766f97cf56b491e55ab3abede044eb @jnicklas jnicklas committed Jan 30, 2010
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/capybara/driver/celerity_driver.rb
  2. +4 −0 spec/drivers_spec.rb
  3. +1 −0 spec/views/with_html.erb
@@ -10,7 +10,7 @@ def [](name)
else
node.send(name.to_sym)
end
- return value if value and not value.empty?
+ return value if value and not value.to_s.empty?
end
def set(value)
@@ -47,6 +47,10 @@
@driver.find('//a')[1][:rel].should be_nil
end
+ it "should extract boolean node attributes" do
+ @driver.find('//input[@id="checked_field"]')[0][:checked].should be_true
+ end
+
it "should allow assignment of field value" do
@driver.find('//input').first.value.should == 'monkey'
@driver.find('//input').first.set('gorilla')
@@ -26,6 +26,7 @@
<a href="/with_simple_html#anchor">Anchor on different page</a>
<a href="/with_html#anchor">Anchor on same page</a>
<input type="text" value="" id="test_field">
+ <input type="text" checked="checked" id="checked_field">
<a href="/redirect"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="very fine image" /></a>
<a href="/with_simple_html"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="fine image" /></a>
</p>

0 comments on commit 95a63f8

Please sign in to comment.