diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-11 14:55:00 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-11 14:55:00 +0000 |
commit | 668e1f4c4cf63e1fa99ebd7d756a8d95609a2c2e (patch) | |
tree | 3e51ec7898299503cf925a0f3498d6f533688aac /spec | |
parent | 174bed309b113d289c61aad054d7be0fe3ef4da7 (diff) | |
parent | 094add464e7edb9490422ae3e01c1577340840aa (diff) | |
download | gitlab-ce-668e1f4c4cf63e1fa99ebd7d756a8d95609a2c2e.tar.gz |
Merge branch 'replace_group_links.feature' into 'master'
Replace 'project/group_links.feature' spinach test with an rspec analog
See merge request !14169
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/settings/user_manages_group_links_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/features/projects/settings/user_manages_group_links_spec.rb b/spec/features/projects/settings/user_manages_group_links_spec.rb new file mode 100644 index 00000000000..91e8059865c --- /dev/null +++ b/spec/features/projects/settings/user_manages_group_links_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +describe 'User manages group links' do + include Select2Helper + + let(:user) { create(:user) } + let(:project) { create(:project, namespace: user.namespace) } + let(:group_ops) { create(:group, name: 'Ops') } + let(:group_market) { create(:group, name: 'Market', path: 'market') } + + before do + project.add_master(user) + sign_in(user) + + share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER) + share_link.group_id = group_ops.id + share_link.save! + + visit(project_group_links_path(project)) + end + + it 'shows a list of groups' do + page.within('.project-members-groups') do + expect(page).to have_content('Ops') + expect(page).not_to have_content('Market') + end + end + + it 'shares a project with a group', :js do + click_link('Share with group') + + select2(group_market.id, from: '#link_group_id') + select('Master', from: 'link_group_access') + + click_button('Share') + + page.within('.project-members-groups') do + expect(page).to have_content('Market') + end + end +end |