diff options
author | Robert Speicher <robert@gitlab.com> | 2016-11-18 13:05:22 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-11-18 13:05:22 +0000 |
commit | bccdf9f5570728eb312fb0bde26467dfa61d6a91 (patch) | |
tree | 26561c69ca373a72bc8c7c37c281dc1e7a35990b /spec/features | |
parent | d389ed730fc87cc8051ec04f9fa8385270852411 (diff) | |
parent | 6b5aa83354b3dff903eb099bf03da733c36958fc (diff) | |
download | gitlab-ce-bccdf9f5570728eb312fb0bde26467dfa61d6a91.tar.gz |
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
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_groups_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb new file mode 100644 index 00000000000..f6d625fa7f6 --- /dev/null +++ b/spec/features/admin/admin_groups_spec.rb @@ -0,0 +1,35 @@ +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 |