Closed swt2public closed 5 years ago
Sorry, it's not working for me yet:
When creating an author without last name Then validation should fail
Expected #<author id: nil, first_name: "alan", last_name: nil, homepage: "http://example.com", created_at: nil, updated_at: nil> not to be valid
If you have problems solving this task, please don't hesitate to contact the teaching team!
Sorry, it's not working for me yet:
When creating an author without last name Then validation should fail
Expected #<author id: nil, first_name: "alan", last_name: nil, homepage: "http://example.com", created_at: nil, updated_at: nil> not to be valid
If you have problems solving this task, please don't hesitate to contact the teaching team!
Sorry, it's not working for me yet:
When creating an author without last name Then validation should fail
Expected #<author id: nil, first_name: "alan", last_name: nil, homepage: "http://example.com", created_at: nil, updated_at: nil> not to be valid
If you have problems solving this task, please don't hesitate to contact the teaching team!
Scenario
When creating an author without last name Then validation should fail
Hints
Author data should only be added to the system if it reaches a certain quality. Especially, every author should have a last name, that is also not just an empty string. These checks are called 'validations' in Ruby on Rails.
For the tests, the
be_valid
matcher can be used to test if a model instance passes all validations:expect(@author).to_not be_valid
What do you think is the correct place to test this behavior, is it a model or a feature test?
You can learn about validations in this part of the guide.
Error
Estimated progress: 38% complete