diff options
Diffstat (limited to 'spec/policies/group_policy_spec.rb')
-rw-r--r-- | spec/policies/group_policy_spec.rb | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index 3ef859376a4..57923142648 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe GroupPolicy do include_context 'GroupPolicy context' - using RSpec::Parameterized::TableSyntax context 'public group with no user' do let(:group) { create(:group, :public, :crm_enabled) } @@ -1231,29 +1230,11 @@ RSpec.describe GroupPolicy do it { is_expected.to be_disallowed(:admin_crm_organization) } end - describe 'maintain_namespace' do - context 'with non-admin roles' do - where(:role, :allowed) do - :guest | false - :reporter | false - :developer | false - :maintainer | true - :owner | true - end - - with_them do - let(:current_user) { public_send(role) } + it_behaves_like 'checks timelog categories permissions' do + let(:group) { create(:group) } + let(:namespace) { group } + let(:users_container) { group } - it do - expect(subject.allowed?(:maintain_namespace)).to eq allowed - end - end - end - - context 'as an admin', :enable_admin_mode do - let(:current_user) { admin } - - it { is_expected.to be_allowed(:maintain_namespace) } - end + subject { described_class.new(current_user, group) } end end |