Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cover new model with tests
require 'rails_helper'
RSpec.describe User, type: :model do
it { should have_secure_password }
it { should validate_presence_of :name }
it { should validate_presence_of :email }
it { should validate_uniqueness_of(:email).case_insensitive }
it { should_not allow_value('test').for(:email) }
it { should allow_value('test@test.com').for(:email) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment