2016-06-17 23:44:15 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
feature '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
|
|
|
|
|
|
|
background do
|
|
|
|
project.team << [user, :developer]
|
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
|
|
|
|
|
|
|
|
scenario '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
|