Module: Kelp::Checkbox
Instance Method Summary (collapse)
-
- (Object) checkbox_should_be_checked(checkbox, scope = {})
Verify that the given checkbox is checked.
-
- (Object) checkbox_should_not_be_checked(checkbox, scope = {})
Verify that the given checkbox is not checked.
Methods included from Helper
#listify, #nice_find_field, #rspec_unexpected
Methods included from Scoping
#in_scope, #kelp_within, #scope_within
Instance Method Details
- (Object) checkbox_should_be_checked(checkbox, scope = {})
Verify that the given checkbox is checked.
22 23 24 25 26 27 28 29 30 |
# File 'lib/kelp/checkbox.rb', line 22 def checkbox_should_be_checked(checkbox, scope={}) in_scope(scope) do field_checked = find_field(checkbox)['checked'] if !field_checked raise Kelp::Unexpected, "Expected '#{checkbox}' to be checked, but it is unchecked." end end end |
- (Object) checkbox_should_not_be_checked(checkbox, scope = {})
Verify that the given checkbox is not checked.
45 46 47 48 49 50 51 52 53 |
# File 'lib/kelp/checkbox.rb', line 45 def checkbox_should_not_be_checked(checkbox, scope={}) in_scope(scope) do field_checked = find_field(checkbox)['checked'] if field_checked raise Kelp::Unexpected, "Expected '#{checkbox}' to be unchecked, but it is checked." end end end |