Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-02-09 17:51:06 +0300
committerRémy Coutable <remy@rymai.me>2016-02-09 20:15:35 +0300
commitb34963bc125d11af7b9c993d1233258f084e580d (patch)
treea428e07d6da540a852a1f182073e16ee317546da /spec/models/email_spec.rb
parenta52c5778bb9d95097cc965539731a2ef846c3ff0 (diff)
Validate email addresses using Devise.email_regexp
Also: - Get rid of legacy :strict_mode - Get rid of custom :email validator - Add some shared examples to spec emails validation
Diffstat (limited to 'spec/models/email_spec.rb')
-rw-r--r--spec/models/email_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb
new file mode 100644
index 00000000000..a20a6149649
--- /dev/null
+++ b/spec/models/email_spec.rb
@@ -0,0 +1,22 @@
+# == Schema Information
+#
+# Table name: emails
+#
+# id :integer not null, primary key
+# user_id :integer not null
+# email :string(255) not null
+# created_at :datetime
+# updated_at :datetime
+#
+
+require 'spec_helper'
+
+describe Email, models: true do
+
+ describe 'validations' do
+ it_behaves_like 'an object with email-formated attributes', :email do
+ subject { build(:email) }
+ end
+ end
+
+end