Test Custom ActiveRecord Validations

Victor Hazbun
InstructorVictor Hazbun

Share this video with your friends

Send Tweet
Published 3 years ago
Updated a year ago

Learn how to test custom ActiveRecord validations using RSpec.

In this lesson we'll write a test that expects the email to be found on the invitations table. We'll see that at first this test fails because we need to add the custom validation on the user model. Once we implement the validation and create the InvitedValidator, the test will pass.