diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-28 12:09:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-28 12:09:34 +0300 |
commit | 0f59ad0c29c8679957c716317c842f606177f223 (patch) | |
tree | 387d1f932ad462e2906c840160e0305671acc274 /spec/features | |
parent | 99454db49e04656e8df692c5a1c4582fec50eee3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/groups_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index d2e65c02e37..c1cb0b4951e 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -262,6 +262,42 @@ describe 'Group' do end end + describe 'new subgroup / project button' do + let(:group) { create(:group, project_creation_level: Gitlab::Access::NO_ONE_PROJECT_ACCESS, subgroup_creation_level: Gitlab::Access::OWNER_SUBGROUP_ACCESS) } + + it 'new subgroup button is displayed without project creation permission' do + visit group_path(group) + + page.within '.group-buttons' do + expect(page).to have_link('New subgroup') + end + end + + it 'new subgroup button is displayed together with new project button when having project creation permission' do + group.update!(project_creation_level: Gitlab::Access::MAINTAINER_PROJECT_ACCESS) + visit group_path(group) + + page.within '.group-buttons' do + expect(page).to have_css("li[data-text='New subgroup']", visible: false) + expect(page).to have_css("li[data-text='New project']", visible: false) + end + end + + it 'new project button is displayed without subgroup creation permission' do + group.update!(project_creation_level: Gitlab::Access::MAINTAINER_PROJECT_ACCESS) + user = create(:user) + + group.add_maintainer(user) + sign_out(:user) + sign_in(user) + + visit group_path(group) + page.within '.group-buttons' do + expect(page).to have_link('New project') + end + end + end + def remove_with_confirm(button_text, confirm_with) click_button button_text fill_in 'confirm_name_input', with: confirm_with |