GRN-46: Scoped user email uniqueness validation (#342)

* Scoped user email uniqueness validation

* Scoped user email uniqueness validation

* Scoped user email uniqueness validation

* Extended User test for check email scope
This commit is contained in:
Jesus Federico
2019-01-17 16:27:50 -05:00
committed by GitHub
parent e915aba9db
commit 4d9d0ebb97
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ describe User, type: :model do
it { should validate_presence_of(:provider) }
it { should validate_uniqueness_of(:email).case_insensitive }
it { should validate_uniqueness_of(:email).scoped_to(:provider).case_insensitive }
it { should validate_length_of(:email).is_at_most(256) }
it { should allow_value("", nil).for(:email) }
it { should allow_value("valid@email.com").for(:email) }