tests for Node#disabled? behavior with option elements

This commit is contained in:
Thomas Walpole 2013-03-15 12:10:15 -07:00
parent 2716e7fdf7
commit 170ffee951
2 changed files with 13 additions and 0 deletions

View File

@ -99,6 +99,18 @@ Capybara::SpecHelper.spec "node" do
@session.find('//input[@id="customer_name"]').should be_disabled
@session.find('//input[@id="customer_email"]').should_not be_disabled
end
it "should see disabled options as disabled" do
@session.visit('/form')
@session.find('//select[@id="form_title"]/option[1]').should_not be_disabled
@session.find('//select[@id="form_title"]/option[@disabled]').should be_disabled
end
it "should see enabled options in disabled select as disabled" do
@session.visit('/form')
@session.find('//select[@id="form_disabled_select"]/option').should be_disabled
@session.find('//select[@id="form_title"]/option[1]').should_not be_disabled
end
end
describe "#visible?" do

View File

@ -8,6 +8,7 @@
<option>Mrs</option>
<option>Mr</option>
<option>Miss</option>
<option disabled="disabled">Other</option>
</select>
</p>