|
379 | 379 | 'request_headers' => ['append MirrorID "mirror 12"'], |
380 | 380 | 'rewrites' => [ |
381 | 381 | { |
382 | | - 'rewrite_rule' => ['^index\.html$ welcome.html'], |
| 382 | + 'rewrite_rule' => ['^index.html$ rewrites.html'], |
383 | 383 | }, |
384 | 384 | ], |
385 | 385 | 'filters' => [ |
|
392 | 392 | 'FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no', |
393 | 393 | ], |
394 | 394 | 'rewrite_base' => '/', |
395 | | - 'rewrite_rule' => '^index\.html$ welcome.html', |
| 395 | + 'rewrite_rule' => '^index.html$ welcome.html', |
396 | 396 | 'rewrite_cond' => ['%{HTTP_USER_AGENT} ^MSIE'], |
397 | 397 | 'rewrite_inherit' => true, |
398 | 398 | 'setenv' => ['FOO=/bin/true'], |
|
733 | 733 | } |
734 | 734 | it { is_expected.to contain_concat__fragment('rspec.example.com-redirect') } |
735 | 735 | it { |
736 | | - is_expected.to contain_concat__fragment('rspec.example.com-rewrite').with( |
737 | | - content: %r{^\s+RewriteOptions Inherit$}, |
738 | | - ) |
| 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\$ rewrites.html$}) |
739 | 741 | } |
740 | 742 | it { is_expected.to contain_concat__fragment('rspec.example.com-scriptalias') } |
741 | 743 | it { is_expected.to contain_concat__fragment('rspec.example.com-serveralias') } |
|
1812 | 1814 | end |
1813 | 1815 |
|
1814 | 1816 | it { |
1815 | | - is_expected.to contain_concat__fragment('rspec.example.com-rewrite').with( |
1816 | | - content: %r{^\s+RewriteOptions Inherit$}, |
| 1817 | + is_expected.not_to contain_concat__fragment('rspec.example.com-rewrite') |
| 1818 | + .with_content(%r{^\s+RewriteOptions Inherit$}) |
| 1819 | + .with_content(%r{^\s+RewriteEngine On$}) |
| 1820 | + .with_content(%r{^\s+RewriteRule \^index\.html\$ welcome.html$}) |
| 1821 | + } |
| 1822 | + end |
| 1823 | + context 'empty rewrites_without_rewrite_inherit' do |
| 1824 | + let(:params) do |
| 1825 | + super().merge( |
| 1826 | + 'rewrite_inherit' => false, |
| 1827 | + 'rewrites' => [], |
1817 | 1828 | ) |
| 1829 | + end |
| 1830 | + |
| 1831 | + it { |
| 1832 | + is_expected.not_to contain_concat__fragment('rspec.example.com-rewrite') |
| 1833 | + .with_content(%r{^\s+RewriteEngine On$}) |
| 1834 | + .with_content(%r{^\s+RewriteRule \^index\.html\$ welcome.html$}) |
| 1835 | + .without(content: %r{^\s+RewriteOptions Inherit$}) |
1818 | 1836 | } |
1819 | 1837 | end |
1820 | 1838 |
|
|
0 commit comments