From e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Thu, 28 Sep 2017 16:49:42 +0000 Subject: Support custom attributes on users --- spec/models/user_custom_attribute_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 spec/models/user_custom_attribute_spec.rb (limited to 'spec/models/user_custom_attribute_spec.rb') 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 -- cgit v1.2.3