From 5809400da430287afb9d3c5ea05b7dea216f1c60 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 11 Sep 2019 12:04:16 +1200 Subject: [PATCH] Add tests for PagesDomain#pages_virtual_domain --- spec/models/pages_domain_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index 5168064bb84..f745820a404 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -556,4 +556,16 @@ describe PagesDomain do ) end end + + describe '.pages_virtual_domain' do + let(:project) { build(:project) } + + subject(:pages_domain) { build(:pages_domain, project: project) } + + it 'returns instance of Pages::VirtualDomain' do + expect(Pages::VirtualDomain).to receive(:new).with([project], domain: pages_domain).and_call_original + + expect(pages_domain.pages_virtual_domain).to be_a(Pages::VirtualDomain) + end + end end