debian-mirror-gitlab/spec/workers/group_destroy_worker_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
557 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe GroupDestroyWorker do
2016-09-13 17:45:13 +05:30
let(:group) { create(:group) }
2017-09-10 17:25:29 +05:30
let!(:project) { create(:project, namespace: group) }
2021-03-08 18:12:59 +05:30
let(:user) { create(:user) }
before do
group.add_owner(user)
end
2016-09-13 17:45:13 +05:30
2017-08-17 22:00:37 +05:30
subject { described_class.new }
2016-09-13 17:45:13 +05:30
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