Skip to content

Commit c25a58a

Browse files
committed
add rspec tests
1 parent 4a884c7 commit c25a58a

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

spec/defines/vhost_spec.rb

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
'request_headers' => ['append MirrorID "mirror 12"'],
380380
'rewrites' => [
381381
{
382-
'rewrite_rule' => ['^index\.html$ welcome.html'],
382+
'rewrite_rule' => ['^index\.html$ rewrites.html'],
383383
},
384384
],
385385
'filters' => [
@@ -733,8 +733,11 @@
733733
}
734734
it { is_expected.to contain_concat__fragment('rspec.example.com-redirect') }
735735
it {
736-
is_expected.to contain_concat__fragment('rspec.example.com-rewrite').with(
737-
content: %r{^\s+RewriteOptions Inherit$},
736+
is_expected.to contain_concat__fragment('rspec.example.com-rewrite')
737+
.with_content(%r{^\s+RewriteEngine On$})
738+
.with_content(%r{^\s+RewriteOptions Inherit$})
739+
.with_content(%r{^\s+RewriteBase /})
740+
.with_content(%r{^\s+RewriteRule ^index\.html$ welcome.html$})
738741
)
739742
}
740743
it { is_expected.to contain_concat__fragment('rspec.example.com-scriptalias') }
@@ -1812,9 +1815,25 @@
18121815
end
18131816

18141817
it {
1815-
is_expected.to contain_concat__fragment('rspec.example.com-rewrite').with(
1816-
content: %r{^\s+RewriteOptions Inherit$},
1818+
is_expected.to contain_concat__fragment('rspec.example.com-rewrite')
1819+
.with_content(%r{^\s+RewriteOptions Inherit$})
1820+
.with_content(%r{^\s+RewriteEngine On$})
1821+
.with_content(%r{^\s+RewriteRule ^index\.html$ welcome.html$})
1822+
}
1823+
end
1824+
context 'empty rewrites_without_rewrite_inherit' do
1825+
let(:params) do
1826+
super().merge(
1827+
'rewrite_inherit' => false,
1828+
'rewrites' => [],
18171829
)
1830+
end
1831+
1832+
it {
1833+
is_expected.to contain_concat__fragment('rspec.example.com-rewrite')
1834+
.with_content(%r{^\s+RewriteEngine On$})
1835+
.with_content(%r{^\s+RewriteRule ^index\.html$ welcome.html$})
1836+
.without( content: %r{^\s+RewriteOptions Inherit$})
18181837
}
18191838
end
18201839

0 commit comments

Comments
 (0)