diff options
author | Jarka Košanová <jarka@gitlab.com> | 2018-12-18 15:15:51 +0300 |
---|---|---|
committer | Jarka Košanová <jarka@gitlab.com> | 2018-12-19 17:24:29 +0300 |
commit | b1c39553859bb1f5f830fa759f2202462fe24d98 (patch) | |
tree | 235757cdbb225f709ecf105187b69a5f39c711bf /spec/services | |
parent | b1b7fa7802eecbacff04a9434eff69b0f3cbaaad (diff) |
Rename GroupHierarchy into ObjectHierarchy
- we now use the hierarchy class also for epics
- also rename supports_nested_groups? into supports_nested_objects?
- move it to a concern
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/groups/create_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/groups/nested_create_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/groups/transfer_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/notification_service_spec.rb | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/spec/services/groups/create_service_spec.rb b/spec/services/groups/create_service_spec.rb index 224e933bebc..fe6a8691ae0 100644 --- a/spec/services/groups/create_service_spec.rb +++ b/spec/services/groups/create_service_spec.rb @@ -55,7 +55,7 @@ describe Groups::CreateService, '#execute' do context 'when nested groups feature is disabled' do it 'does not save group and returns an error' do - allow(Group).to receive(:supports_nested_groups?).and_return(false) + allow(Group).to receive(:supports_nested_objects?).and_return(false) is_expected.not_to be_persisted expect(subject.errors[:parent_id]).to include('You don’t have permission to create a subgroup in this group.') @@ -66,7 +66,7 @@ describe Groups::CreateService, '#execute' do context 'when nested groups feature is enabled' do before do - allow(Group).to receive(:supports_nested_groups?).and_return(true) + allow(Group).to receive(:supports_nested_objects?).and_return(true) end context 'as guest' do diff --git a/spec/services/groups/nested_create_service_spec.rb b/spec/services/groups/nested_create_service_spec.rb index 86fdd43c1e5..75d6ddb0a2c 100644 --- a/spec/services/groups/nested_create_service_spec.rb +++ b/spec/services/groups/nested_create_service_spec.rb @@ -30,7 +30,7 @@ describe Groups::NestedCreateService do let(:params) { { group_path: 'a-group' } } before do - allow(Group).to receive(:supports_nested_groups?) { false } + allow(Group).to receive(:supports_nested_objects?) { false } end it 'creates the group' do diff --git a/spec/services/groups/transfer_service_spec.rb b/spec/services/groups/transfer_service_spec.rb index dd8a1cee074..6b48c993c57 100644 --- a/spec/services/groups/transfer_service_spec.rb +++ b/spec/services/groups/transfer_service_spec.rb @@ -9,7 +9,7 @@ describe Groups::TransferService, :postgresql do shared_examples 'ensuring allowed transfer for a group' do context 'with other database than PostgreSQL' do before do - allow(Group).to receive(:supports_nested_groups?).and_return(false) + allow(Group).to receive(:supports_nested_objects?).and_return(false) end it 'should return false' do diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 68ac3a00ab0..d20e712d365 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -2250,7 +2250,7 @@ describe NotificationService, :mailer do # Creates a nested group only if supported # to avoid errors on MySQL def create_nested_group - if Group.supports_nested_groups? + if Group.supports_nested_objects? parent_group = create(:group, :public) child_group = create(:group, :public, parent: parent_group) @@ -2277,7 +2277,7 @@ describe NotificationService, :mailer do end def add_member_for_parent_group(user, project) - return unless Group.supports_nested_groups? + return unless Group.supports_nested_objects? project.reload @@ -2285,13 +2285,13 @@ describe NotificationService, :mailer do end def should_email_nested_group_user(user, times: 1, recipients: email_recipients) - return unless Group.supports_nested_groups? + return unless Group.supports_nested_objects? should_email(user, times: 1, recipients: email_recipients) end def should_not_email_nested_group_user(user, recipients: email_recipients) - return unless Group.supports_nested_groups? + return unless Group.supports_nested_objects? should_not_email(user, recipients: email_recipients) end |