gitlab-org--gitlab-foss/spec/features/projects/members/member_leaves_project_spec.rb
Rémy Coutable bceee98713 Show 'Leave project' only if member can actually leave the project
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-18 06:06:34 +02:00

19 lines
495 B
Ruby

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
click_link 'Leave Project'
expect(current_path).to eq(dashboard_projects_path)
expect(project.users.exists?(user.id)).to be_falsey
end
end