Welcome to mirror list, hosted at ThFree Co, Russian Federation.

projects_spec.rb « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cae11be7cdd32b06c30738d919ae1e077e5ba681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'

describe "Projects", feature: true, js: 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_namespace_project_path(@project.namespace, @project)
    end

    it "should remove project" do
      expect { remove_project }.to change {Project.count}.by(-1)
    end

    it 'should delete the project from disk' do
      expect(GitlabShellWorker).to(
        receive(:perform_async).with(:remove_repository,
                                     /#{@project.path_with_namespace}/)
      ).twice

      remove_project
    end
  end

  def remove_project
    click_link "Remove project"
    fill_in 'confirm_name_input', with: @project.path
    click_button 'Confirm'
  end
end