Learn how to test ActiveRecord validations using RSpec.
In this lesson we'll write a test that expects the name
attribute to be present on the User model instance. We'll see that at first this test fails because we need to add this validation on the model.