summaryrefslogtreecommitdiff
path: root/spec/features/projects_spec.rb
blob: 98ba5a47ee53c8108830df92533ee96869952fb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'

describe "Projects", feature: true  do
  before { login_as :user }

  describe "DELETE /projects/:id" do
    before do
      @project = create(:project, namespace: @user.namespace)
      @project.team << [@user, :master]
      visit edit_project_path(@project)
    end

    it "should be correct path", js: true do
      expect {
        click_link "Remove project"
        fill_in 'confirm_name_input', with: @project.path
        click_button 'Confirm'
      }.to change {Project.count}.by(-1)
    end
  end
end