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
# goes in features/step_definitions | |
Then /^I should see the "([^"]*)" error for "([^"]*)"$/ do |error, label| | |
field = find_field(label) | |
html_label = find("label[for=#{field[:id]}][class=error]") | |
html_label.text.should eql(error) | |
end | |
Then /^I should not see errors for "([^"]*)"$/ do |label| | |
field = find_field(label) | |
lambda {find("label[for=#{field[:id]}][class=error]")}.should raise_error(Capybara::ElementNotFound) |