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

project_destroy_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b910d9b91e90463d3376adcafc969cabb8c0f25 (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
require 'spec_helper'

describe ProjectDestroyWorker do
  let(:project) { create(:project) }
  let(:path) { project.repository.path_to_repo }

  subject { ProjectDestroyWorker.new }

  describe "#perform" do
    it "deletes the project" do
      subject.perform(project.id, project.owner, {})

      expect(Project.all).not_to include(project)
      expect(Dir.exist?(path)).to be_falsey
    end

    it "deletes the project but skips repo deletion" do
      subject.perform(project.id, project.owner, { "skip_repo" => true })

      expect(Project.all).not_to include(project)
      expect(Dir.exist?(path)).to be_truthy
    end
  end
end