diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-09-28 16:49:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-28 16:49:42 +0000 |
commit | e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 (patch) | |
tree | d2402a99dd96927ae458f49cbd7de8ad043e297a /spec/policies | |
parent | 93a33556e3e01a83c1af9c21e11ff433b624c40d (diff) | |
download | gitlab-ce-e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489.tar.gz |
Support custom attributes on users
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/global_policy_spec.rb | 14 |
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 |