webrat/spec/webrat/core/field_spec.rb

16 lines
556 B
Ruby
Raw Normal View History

2008-10-25 16:22:55 +00:00
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
2008-10-23 04:28:36 +00:00
module Webrat
describe CheckboxField do
it "should say it is checked if it is" do
checkbox = CheckboxField.new(nil, (Webrat::XML.document("<input type='checkbox' checked='checked'>").search('input')).first)
2008-10-23 04:28:36 +00:00
checkbox.should be_checked
end
it "should say it is not checked if it is not" do
checkbox = CheckboxField.new(nil, (Webrat::XML.document("<input type='checkbox'>").search('input')).first)
2008-10-23 04:28:36 +00:00
checkbox.should_not be_checked
end
end
end