diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/features/admin/admin_projects_spec.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/features/admin/admin_projects_spec.rb')
-rw-r--r-- | spec/features/admin/admin_projects_spec.rb | 97 |
1 files changed, 23 insertions, 74 deletions
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index aab2e6d7cef..bf280595ec7 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -92,97 +92,46 @@ RSpec.describe "Admin::Projects" do end end - context 'when `vue_project_members_list` feature flag is enabled', :js do - describe 'admin adds themselves to the project' do - before do - project.add_maintainer(user) - stub_feature_flags(invite_members_group_modal: false) - end - - it 'adds admin to the project as developer', :js do - visit project_project_members_path(project) - - page.within '.invite-users-form' do - select2(current_user.id, from: '#user_ids', multiple: true) - select 'Developer', from: 'access_level' - end - - click_button 'Invite' - - expect(find_member_row(current_user)).to have_content('Developer') - end + describe 'admin adds themselves to the project', :js do + before do + project.add_maintainer(user) + stub_feature_flags(invite_members_group_modal: false) end - describe 'admin removes themselves from the project' do - before do - project.add_maintainer(user) - project.add_developer(current_user) - end - - it 'removes admin from the project' do - visit project_project_members_path(project) - - expect(find_member_row(current_user)).to have_content('Developer') + it 'adds admin to the project as developer' do + visit project_project_members_path(project) - page.within find_member_row(current_user) do - click_button 'Leave' - end + page.within '.invite-users-form' do + select2(current_user.id, from: '#user_ids', multiple: true) + select 'Developer', from: 'access_level' + end - page.within('[role="dialog"]') do - click_button('Leave') - end + click_button 'Invite' - expect(current_path).to match dashboard_projects_path - end + expect(find_member_row(current_user)).to have_content('Developer') end end - context 'when `vue_project_members_list` feature flag is disabled' do + describe 'admin removes themselves from the project', :js do before do - stub_feature_flags(vue_project_members_list: false) + project.add_maintainer(user) + project.add_developer(current_user) end - describe 'admin adds themselves to the project' do - before do - project.add_maintainer(user) - stub_feature_flags(invite_members_group_modal: false) - end - - it 'adds admin to the project as developer', :js do - visit project_project_members_path(project) - - page.within '.invite-users-form' do - select2(current_user.id, from: '#user_ids', multiple: true) - select 'Developer', from: 'access_level' - end + it 'removes admin from the project' do + visit project_project_members_path(project) - click_button 'Invite' + expect(find_member_row(current_user)).to have_content('Developer') - page.within '.content-list' do - expect(page).to have_content(current_user.name) - expect(page).to have_content('Developer') - end + page.within find_member_row(current_user) do + click_button 'Leave' end - end - describe 'admin removes themselves from the project' do - before do - project.add_maintainer(user) - project.add_developer(current_user) + page.within('[role="dialog"]') do + click_button('Leave') end - it 'removes admin from the project' do - visit project_project_members_path(project) - - page.within '.content-list' do - expect(page).to have_content(current_user.name) - expect(page).to have_content('Developer') - end - - find(:css, '.content-list li', text: current_user.name).find(:css, 'a.btn-danger').click - - expect(page).not_to have_selector(:css, '.content-list') - end + expect(current_path).to match dashboard_projects_path end end end |