Commit b470ed51 authored by Alishan Ladhani's avatar Alishan Ladhani

Prevent #update_daemon from running for instance domains

Since this is not needed, and it would produce errors because there is
no project
parent 27b4290f
......@@ -220,6 +220,8 @@ class PagesDomain < ApplicationRecord
# rubocop: disable CodeReuse/ServiceClass
def update_daemon
return if domain_type_instance?
::Projects::UpdatePagesConfigurationService.new(project).execute
end
# rubocop: enable CodeReuse/ServiceClass
......
......@@ -315,6 +315,14 @@ describe PagesDomain do
end
describe '#update_daemon' do
context 'when domain_type is instance' do
it 'does nothing' do
expect(Projects::UpdatePagesConfigurationService).not_to receive(:new)
create(:pages_domain, domain_type: :instance)
end
end
it 'runs when the domain is created' do
domain = build(:pages_domain)
......
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