Check that a text field is empty with Cucumber
This will not work (it always passes):
Then the "Title" field should contain ""
The value is turned into a regular expression, and an empty regular expression matches any string!
Do this instead for Capybara:
Then the "Title" field should contain "^$"
And do this step for Webrat:
Then /^the "([^"]*)" field should( not)? be empty$/ do |field, negate|
expectation = negate ? :should_not : :should
field_labeled(field).value.send(expectation, be_blank)
end