2016-08-24 12:49:21 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
describe 'Projects > Members > Member leaves project' do
|
2016-08-24 12:49:21 +05:30
|
|
|
let(:user) { create(:user) }
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project, :repository) }
|
2016-08-24 12:49:21 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
before do
|
2018-03-17 18:26:18 +05:30
|
|
|
project.add_developer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
|
|
|
visit project_path(project)
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
it 'user leaves project' do
|
2017-08-17 22:00:37 +05:30
|
|
|
click_link 'Leave project'
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
expect(current_path).to eq(dashboard_projects_path)
|
|
|
|
expect(project.users.exists?(user.id)).to be_falsey
|
|
|
|
end
|
|
|
|
end
|