diff --git a/Gemfile b/Gemfile index 9e2ea4e1..f3273c1a 100644 --- a/Gemfile +++ b/Gemfile @@ -66,6 +66,8 @@ gem 'tumblr_client' gem 'foreman' gem 'redis' +gem 'fake_email_validator' + group :development do # require spring 1.3.5 since shit's on fire on my local instance with 1.3.4 (Gem::LoadError) gem 'spring', '~> 1.3.5' diff --git a/Gemfile.lock b/Gemfile.lock index a6873462..468e48f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,6 +115,9 @@ GEM factory_girl_rails (4.5.0) factory_girl (~> 4.5.0) railties (>= 3.0.0) + fake_email_validator (1.0.11) + activemodel + mail faker (1.4.3) i18n (~> 0.5) faraday (0.9.1) @@ -496,6 +499,7 @@ DEPENDENCIES devise-async devise-i18n factory_girl_rails + fake_email_validator faker fog fog-aws diff --git a/app/models/user.rb b/app/models/user.rb index d5c6973e..1872ece9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,6 +38,7 @@ class User < ActiveRecord::Base screen_name.strip! end + validates :email, fake_email: true validates :screen_name, presence: true, format: { with: SCREEN_NAME_REGEX }, uniqueness: { case_sensitive: false }, screen_name: true validates :display_name, length: { maximum: 50 }