Closed swt2public closed 5 years ago
Sorry, it's not working for me yet:
Given users visit the new author page And fill in only first name and homepage When they click submit Then the page should show an error reporting what went wrong
Expected to find text matching /error/i in "name homepage\ncreate new author back"
If you have problems solving this task, please don't hesitate to contact the teaching team!
Scenario
Given users visit the new author page And fill in only first name and homepage When they click submit Then the page should show an error reporting what went wrong
Hints
The fact that particular set of data cannot be saved should be communicated to the user. Errors of attempted saves of objects are stored in the
errors
attribute.It can be checked (
@author.errors.any?
) and can be iterated over to extract error details (@article.errors.full_messages.each
). Adding this type of code also requires modifying thenew
action of the AuthorsController.Error
Estimated progress: 44% complete