2019-03-30 03:15:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-28 22:54:17 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe GroupDestroyWorker do
|
2016-05-28 22:54:17 -04:00
|
|
|
let(:group) { create(:group) }
|
2017-08-02 15:55:11 -04:00
|
|
|
let!(:project) { create(:project, namespace: group) }
|
2021-01-08 10:10:26 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
group.add_owner(user)
|
|
|
|
end
|
2016-05-28 22:54:17 -04:00
|
|
|
|
2017-05-01 11:13:33 -04:00
|
|
|
subject { described_class.new }
|
2016-05-28 22:54:17 -04:00
|
|
|
|
|
|
|
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
|