Created
March 28, 2019 11:34
-
-
Save MaryKuz/1e5d7b21a6aa340a89c9c0f9831f1699 to your computer and use it in GitHub Desktop.
Cover new model with tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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