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 the new action of the AuthorsController.
Error
Expected to find text matching /error/i in "authors#new\nfind me in app/views/authors/new.html.erb\nfirst name:\nlast name:\nhomepage: http://example.com"
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