Created
October 15, 2009 09:36
-
-
Save tomafro/210852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: | |
Then /^the "([^\"]*)" checkbox should be checked$/ do |label| | |
field_labeled(label).should be_checked | |
end | |
Then /^the "([^\"]*)" checkbox should not be checked$/ do |label| | |
field_labeled(label).should_not be_checked | |
end | |
To something like this: | |
Then /^the "([^\"]*)" checkbox should( not)? be checked$/ do |label, invert| | |
field_labeled(label).should_unless(invert).match be_checked | |
end | |
Or this: | |
Then /^the "([^\"]*)" checkbox should( not)? be checked$/ do |label, invert| | |
swap_shoulds_and_should_nots if invert | |
field_labeled(label).should be_checked | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment