summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-28 16:49:42 +0000
committerRémy Coutable <remy@rymai.me>2017-09-28 16:49:42 +0000
commite9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 (patch)
treed2402a99dd96927ae458f49cbd7de8ad043e297a /spec/policies
parent93a33556e3e01a83c1af9c21e11ff433b624c40d (diff)
downloadgitlab-ce-e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489.tar.gz
Support custom attributes on users
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/global_policy_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb
index a6bf70c1e09..983f0e52d31 100644
--- a/spec/policies/global_policy_spec.rb
+++ b/spec/policies/global_policy_spec.rb
@@ -51,4 +51,18 @@ describe GlobalPolicy do
end
end
end
+
+ describe 'custom attributes' do
+ context 'regular user' do
+ it { is_expected.not_to be_allowed(:read_custom_attribute) }
+ it { is_expected.not_to be_allowed(:update_custom_attribute) }
+ end
+
+ context 'admin' do
+ let(:current_user) { create(:user, :admin) }
+
+ it { is_expected.to be_allowed(:read_custom_attribute) }
+ it { is_expected.to be_allowed(:update_custom_attribute) }
+ end
+ end
end