Commit 252f90ad authored by Robert Speicher's avatar Robert Speicher Committed by Alejandro Rodríguez

Merge branch 'jacopo-beschi/gitlab-ce-19981-admin-links-new-group-default-visibility' into 'master'

Fix Admin Links to new Group does not respect Default Visibility

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/19981

See merge request !7560
parent 3739b455
......@@ -7,7 +7,7 @@
.col-sm-10
= render 'shared/choose_group_avatar_button', f: f
= render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group
= render 'shared/visibility_level', f: f, visibility_level: visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group
.form-group
.col-sm-offset-2.col-sm-10
......
- page_title "Edit", @group.name, "Groups"
%h3.page-title Edit group: #{@group.name}
%hr
= render 'form'
= render 'form', visibility_level: @group.visibility_level
- page_title "New Group"
%h3.page-title New group
%hr
= render 'form'
= render 'form', visibility_level: default_group_visibility
---
title: Make New Group form respect default visibility application setting
merge_request: 7454
author: Jacopo Beschi @jacopo-beschi
require 'spec_helper'
feature 'Admin Groups', feature: true do
let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
before do
login_as(:admin)
stub_application_setting(default_group_visibility: internal)
end
describe 'create a group' do
scenario 'shows the visibility level radio populated with the default value' do
visit new_admin_group_path
expect_selected_visibility(internal)
end
end
describe 'group edit' do
scenario 'shows the visibility level radio populated with the group visibility_level value' do
group = create(:group, :private)
visit edit_admin_group_path(group)
expect_selected_visibility(group.visibility_level)
end
end
def expect_selected_visibility(level)
selector = "#group_visibility_level_#{level}[checked=checked]"
expect(page).to have_selector(selector, count: 1)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment