Commit d7b74a28 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Clean up pages delete service specs

This feature flag was removed a long time ago
parent 7bf372c1
...@@ -3,35 +3,25 @@ ...@@ -3,35 +3,25 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Pages::DeleteService do RSpec.describe Pages::DeleteService do
shared_examples 'remove pages' do let_it_be(:project) { create(:project, path: "my.project")}
let_it_be(:project) { create(:project, path: "my.project")} let_it_be(:admin) { create(:admin) }
let_it_be(:admin) { create(:admin) } let_it_be(:domain) { create(:pages_domain, project: project) }
let_it_be(:domain) { create(:pages_domain, project: project) } let_it_be(:service) { described_class.new(project, admin)}
let_it_be(:service) { described_class.new(project, admin)}
it 'deletes published pages' do it 'deletes published pages' do
expect_any_instance_of(Gitlab::PagesTransfer).to receive(:rename_project).and_return true expect_any_instance_of(Gitlab::PagesTransfer).to receive(:rename_project).and_return true
expect(PagesWorker).to receive(:perform_in).with(5.minutes, :remove, project.namespace.full_path, anything) expect(PagesWorker).to receive(:perform_in).with(5.minutes, :remove, project.namespace.full_path, anything)
Sidekiq::Testing.inline! { service.execute } Sidekiq::Testing.inline! { service.execute }
expect(project.reload.pages_metadatum.deployed?).to be(false) expect(project.reload.pages_metadatum.deployed?).to be(false)
end
it 'deletes all domains' do
expect(project.pages_domains.count).to be 1
Sidekiq::Testing.inline! { service.execute }
expect(project.reload.pages_domains.count).to be 0
end
end end
context 'with feature flag enabled' do it 'deletes all domains' do
before do expect(project.pages_domains.count).to be 1
expect(PagesRemoveWorker).to receive(:perform_async).and_call_original
end Sidekiq::Testing.inline! { service.execute }
it_behaves_like 'remove pages' expect(project.reload.pages_domains.count).to be 0
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment