2016-08-24 12:49:21 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'Projects > Members > Member leaves project', feature: true do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
background do
|
|
|
|
project.team << [user, :developer]
|
|
|
|
login_as(user)
|
|
|
|
visit namespace_project_path(project.namespace, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario '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
|