mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
14 lines
371 B
Ruby
14 lines
371 B
Ruby
require "spec_helper"
|
|
|
|
RSpec.describe User, type: :model do
|
|
it { is_expected.to validate_presence_of(:email) }
|
|
it { is_expected.to validate_presence_of(:password_digest) }
|
|
|
|
it "validates uniqueness of email" do
|
|
create(:user, email: "test@example.com")
|
|
user = User.new(email: "test@example.com")
|
|
|
|
expect(user).to validate_uniqueness_of(:email)
|
|
end
|
|
end
|