When creating an author without last name
Then validation should fail
Hints
Author data should pass checks, i.e. validations in Ruby on Rails, before being saved.
In particular, an author's last name should not be an empty string.
In your test for this behavior, be_valid can be used to test if a model instance passes validations:
expect(@author).to_not be_valid
Scenario
When creating an author without last name Then validation should fail
Hints
Author data should pass checks, i.e. validations in Ruby on Rails, before being saved. In particular, an author's last name should not be an empty string.
In your test for this behavior,
be_valid
can be used to test if a model instance passes validations:expect(@author).to_not be_valid
Here is the relevant section of the guide.
Error
13/44 exercise tests have passed