blob: 2632bc2f5bd0cb60bb64405b2ffb707bd83c7b47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Projects > Members > Member leaves project', feature_category: :subgroups do
include Spec::Support::Helpers::Features::MembersHelpers
include Spec::Support::Helpers::ModalHelpers
let(:user) { create(:user) }
let(:project) { create(:project, :repository, :with_namespace_settings) }
before do
project.add_developer(user)
sign_in(user)
end
it 'user leaves project' do
visit project_path(project)
click_link 'Leave project'
expect(page).to have_current_path(dashboard_projects_path, ignore_query: true)
expect(project.users.exists?(user.id)).to be_falsey
end
it 'user leaves project by url param', :js do
visit project_path(project, leave: 1)
accept_gl_confirm(button_text: 'Leave project')
wait_for_all_requests
expect(page).to have_current_path(dashboard_projects_path, ignore_query: true)
sign_in(project.first_owner)
visit project_project_members_path(project)
expect(members_table).not_to have_content(user.name)
end
end
|