diff --git a/app/validators/user_validator.rb b/app/validators/user_validator.rb index 71ae396bef..e5e212fa26 100644 --- a/app/validators/user_validator.rb +++ b/app/validators/user_validator.rb @@ -54,7 +54,7 @@ def validate_date_of_birth_not_before_1920(date_of_birth, record) def validate_email_unique(record) if User.exists?(email: record.email) - record.errors.add(:base, I18n.t('activerecord.errors.messages.email_uniqueness')) + record.errors.add(:base, I18n.t("activerecord.errors.messages.email_uniqueness")) end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5bbc2ae39d..c0563d6165 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -55,11 +55,11 @@ expect(user.errors[:base]).to eq([" Date of birth must be on or after 1/1/1920."]) end - it 'shows custom email uniqueness error message' do + it "shows custom email uniqueness error message" do create(:user, email: "volunteer1@example.com") - user = build(:user, email: 'volunteer1@example.com') + user = build(:user, email: "volunteer1@example.com") expect(user.valid?).to be false - expect(user.errors[:base]).to eq ([I18n.t('activerecord.errors.messages.email_uniqueness')]) + expect(user.errors[:base]).to eq([I18n.t("activerecord.errors.messages.email_uniqueness")]) end it "has an empty old_emails array when initialized" do