summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-07-01 13:41:32 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-02 11:36:05 -0700
commit0cacb35552e6c30f9cb03f17d1953063fc551aa5 (patch)
tree5fcea40c46355e31ae176fb58bd277d412409dcf /spec
parent3bb1539f24ed642971b16bd9dbb75d7cbb71b08a (diff)
downloadgitlab-ce-0cacb35552e6c30f9cb03f17d1953063fc551aa5.tar.gz
Apply changes recomended by merge request coach
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/admin/groups_controller_spec.rb6
-rw-r--r--spec/features/admin/admin_groups_spec.rb9
-rw-r--r--spec/features/groups/show_spec.rb4
-rw-r--r--spec/services/groups/create_service_spec.rb9
4 files changed, 13 insertions, 15 deletions
diff --git a/spec/controllers/admin/groups_controller_spec.rb b/spec/controllers/admin/groups_controller_spec.rb
index 398f587bafe..1123563c1e3 100644
--- a/spec/controllers/admin/groups_controller_spec.rb
+++ b/spec/controllers/admin/groups_controller_spec.rb
@@ -70,13 +70,11 @@ describe Admin::GroupsController do
end
it 'updates the subgroup_creation_level successfully' do
- OWNER = ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
-
expect do
post :update,
params: { id: group.to_param,
- group: { subgroup_creation_level: OWNER } }
- end.to change { group.reload.subgroup_creation_level }.to(OWNER)
+ group: { subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS } }
+ end.to change { group.reload.subgroup_creation_level }.to(::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
end
end
end
diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb
index 735ca60f7da..35c384dd458 100644
--- a/spec/features/admin/admin_groups_spec.rb
+++ b/spec/features/admin/admin_groups_spec.rb
@@ -102,6 +102,15 @@ describe 'Admin Groups' do
expect_selected_visibility(group.visibility_level)
end
+ it 'shows the subgroup creation level dropdown populated with the group subgroup_creation_level value' do
+ group = create(:group, :private, :owner_subgroup_creation_only)
+
+ visit admin_group_edit_path(group)
+
+ expect(page).to have_select("group_subgroup_creation_level",
+ selected: ::Gitlab::Access.subgroup_creation_options.keys[group.subgroup_creation_level])
+ end
+
it 'edit group path does not change group name', :js do
group = create(:group, :private)
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index ef0e885ee5f..5096abadb79 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -71,7 +71,7 @@ describe 'Group show page' do
sign_in(owner)
end
- context 'when subgroups are supported', :js, :nested_groups do
+ context 'when subgroups are supported', :nested_groups do
before do
allow(Group).to receive(:supports_nested_objects?) { true }
visit path
@@ -101,7 +101,7 @@ describe 'Group show page' do
sign_in(maintainer)
end
- context 'when subgroups are supported', :js, :nested_groups do
+ context 'when subgroups are supported', :nested_groups do
before do
allow(Group).to receive(:supports_nested_objects?) { true }
end
diff --git a/spec/services/groups/create_service_spec.rb b/spec/services/groups/create_service_spec.rb
index b4e6ddddfac..c5ff6cdbacd 100644
--- a/spec/services/groups/create_service_spec.rb
+++ b/spec/services/groups/create_service_spec.rb
@@ -1,4 +1,3 @@
-# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
@@ -88,14 +87,6 @@ describe Groups::CreateService, '#execute' do
it { is_expected.to be_persisted }
end
-
- context 'as maintainer' do
- before do
- group.add_maintainer(user)
- end
-
- it { is_expected.to be_persisted }
- end
end
end