2016-06-17 23:44:15 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Projects > Members > Member leaves project' do
|
2016-06-17 23:44:15 -04:00
|
|
|
let(:user) { create(:user) }
|
2017-07-24 18:51:14 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2016-06-17 23:44:15 -04:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
before do
|
2017-12-22 03:18:28 -05:00
|
|
|
project.add_developer(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2016-06-17 23:44:15 -04:00
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'user leaves project' do
|
2016-11-19 10:40:41 -05:00
|
|
|
click_link 'Leave project'
|
2016-06-17 23:44:15 -04:00
|
|
|
|
|
|
|
expect(current_path).to eq(dashboard_projects_path)
|
|
|
|
expect(project.users.exists?(user.id)).to be_falsey
|
|
|
|
end
|
|
|
|
end
|