Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Test Custom ActiveRecord Validations

    Victor HazbunVictor Hazbun
    railsRuby on Rails

    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.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss