member_leaves_project_spec.rb 450 Bytes
Newer Older
1 2
require 'spec_helper'

3
feature 'Projects > Members > Member leaves project' do
4 5 6 7 8
  let(:user) { create(:user) }
  let(:project) { create(:project) }

  background do
    project.team << [user, :developer]
9
    sign_in(user)
10
    visit project_path(project)
11 12 13
  end

  scenario 'user leaves project' do
14
    click_link 'Leave project'
15 16 17 18 19

    expect(current_path).to eq(dashboard_projects_path)
    expect(project.users.exists?(user.id)).to be_falsey
  end
end