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:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-28 19:49:42 +0300
committerRémy Coutable <remy@rymai.me>2017-09-28 19:49:42 +0300
commite9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 (patch)
treed2402a99dd96927ae458f49cbd7de8ad043e297a /spec/models/user_custom_attribute_spec.rb
parent93a33556e3e01a83c1af9c21e11ff433b624c40d (diff)
Support custom attributes on users
Diffstat (limited to 'spec/models/user_custom_attribute_spec.rb')
-rw-r--r--spec/models/user_custom_attribute_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/user_custom_attribute_spec.rb b/spec/models/user_custom_attribute_spec.rb
new file mode 100644
index 00000000000..37fc3cb64f0
--- /dev/null
+++ b/spec/models/user_custom_attribute_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe UserCustomAttribute do
+ describe 'assocations' do
+ it { is_expected.to belong_to(:user) }
+ end
+
+ describe 'validations' do
+ subject { build :user_custom_attribute }
+
+ it { is_expected.to validate_presence_of(:user_id) }
+ it { is_expected.to validate_presence_of(:key) }
+ it { is_expected.to validate_presence_of(:value) }
+ it { is_expected.to validate_uniqueness_of(:key).scoped_to(:user_id) }
+ end
+end