2016-05-28 22:54:17 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe GroupDestroyWorker do
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:user) { create(:admin) }
|
2017-08-02 15:55:11 -04:00
|
|
|
let!(:project) { create(:project, namespace: group) }
|
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
|