group_destroy_worker_spec.rb 476 Bytes
Newer Older
1 2 3 4 5
require 'spec_helper'

describe GroupDestroyWorker do
  let(:group) { create(:group) }
  let(:user) { create(:admin) }
6
  let!(:project) { create(:project, namespace: group) }
7

8
  subject { described_class.new }
9 10 11 12 13 14 15 16 17 18 19

  describe "#perform" do
    it "deletes the project" do
      subject.perform(group.id, user.id)

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