2012-07-21 16:44:10 -04:00
|
|
|
Capybara::SpecHelper.spec "#uncheck" do
|
|
|
|
before do
|
|
|
|
@session.visit('/form')
|
|
|
|
end
|
2009-12-15 14:58:51 -05:00
|
|
|
|
2012-07-21 16:44:10 -04:00
|
|
|
it "should uncheck a checkbox by id" do
|
|
|
|
@session.uncheck("form_pets_hamster")
|
|
|
|
@session.click_button('awesome')
|
|
|
|
extract_results(@session)['pets'].should include('dog')
|
|
|
|
extract_results(@session)['pets'].should_not include('hamster')
|
|
|
|
end
|
2009-12-15 14:58:51 -05:00
|
|
|
|
2012-07-21 16:44:10 -04:00
|
|
|
it "should uncheck a checkbox by label" do
|
|
|
|
@session.uncheck("Hamster")
|
|
|
|
@session.click_button('awesome')
|
|
|
|
extract_results(@session)['pets'].should include('dog')
|
|
|
|
extract_results(@session)['pets'].should_not include('hamster')
|
2009-12-15 14:58:51 -05:00
|
|
|
end
|
2010-01-18 14:33:22 -05:00
|
|
|
end
|