summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-07-02 08:38:38 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-02 08:38:38 -0700
commita0485e75005e7930acba832089d830744d6cbb14 (patch)
tree5ec2386a0d75fbf825b65c1ecbdde375ba623b6c
parent0f659a0da634bf61378766d6ec247cc49595becf (diff)
downloadgitlab-ce-a0485e75005e7930acba832089d830744d6cbb14.tar.gz
Apply recomended changes from merge coach
-rw-r--r--db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb1
-rw-r--r--spec/features/admin/admin_groups_spec.rb3
-rw-r--r--spec/features/groups/show_spec.rb15
3 files changed, 10 insertions, 9 deletions
diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
index 867ec3b7c91..3b75c92e518 100644
--- a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
+++ b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
@@ -4,7 +4,6 @@ class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
- disable_ddl_transaction!
def up
add_column(:namespaces, :subgroup_creation_level, :integer)
diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb
index 35c384dd458..c1ad73779c9 100644
--- a/spec/features/admin/admin_groups_spec.rb
+++ b/spec/features/admin/admin_groups_spec.rb
@@ -107,8 +107,7 @@ describe 'Admin Groups' do
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])
+ expect(page).to have_content('Allowed to create subgroups')
end
it 'edit group path does not change group name', :js do
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index f1501181432..bed998a0859 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -57,11 +57,11 @@ describe 'Group show page' do
context 'subgroup support' do
let(:restricted_group) do
- create(:group, subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
+ create(:group, subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
end
let(:relaxed_group) do
- create(:group, subgroup_creation_level: ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)
+ create(:group, subgroup_creation_level: ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)
end
let(:owner) { create(:user) }
@@ -78,10 +78,11 @@ describe 'Group show page' do
context 'when subgroups are supported', :nested_groups do
before do
allow(Group).to receive(:supports_nested_objects?) { true }
- visit path
end
it 'allows creating subgroups' do
+ visit path
+
expect(page)
.to have_css("li[data-text='New subgroup']", visible: false)
end
@@ -90,10 +91,11 @@ describe 'Group show page' do
context 'when subgroups are not supported' do
before do
allow(Group).to receive(:supports_nested_objects?) { false }
- visit path
end
it 'does not allow creating subgroups' do
+ visit path
+
expect(page)
.not_to have_selector("li[data-text='New subgroup']", visible: false)
end
@@ -113,11 +115,12 @@ describe 'Group show page' do
context 'when subgroup_creation_level is set to maintainers' do
before do
relaxed_group.add_maintainer(maintainer)
- path = group_path(relaxed_group)
- visit path
end
it 'allows creating subgroups' do
+ path = group_path(relaxed_group)
+ visit path
+
expect(page)
.to have_css("li[data-text='New subgroup']", visible: false)
end