diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 12:08:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-09 12:08:00 +0300 |
commit | aa10b541b6a3fbc7fa712abcc59d073fc8dc620a (patch) | |
tree | cde565fd177bcfd44ea892d6ebbdfcab4fb7cd35 /spec/services/pages | |
parent | a5ba0dd8c6a4221f010a1fabb50aa1239314e3ef (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/pages')
-rw-r--r-- | spec/services/pages/delete_services_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/services/pages/delete_services_spec.rb b/spec/services/pages/delete_services_spec.rb new file mode 100644 index 00000000000..c253f294e80 --- /dev/null +++ b/spec/services/pages/delete_services_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Pages::DeleteService do + let_it_be(:project) { create(:project, path: "my.project")} + let_it_be(:admin) { create(:admin) } + let_it_be(:domain) { create(:pages_domain, project: project) } + let_it_be(:service) { described_class.new(project, admin)} + + it 'deletes published pages' do + 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) + + service.execute + + expect(project.reload.pages_metadatum.deployed?).to be(false) + end + + it 'deletes all domains' do + expect(project.pages_domains.count).to be 1 + + service.execute + + expect(project.reload.pages_domains.count).to be 0 + end +end |