diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index 3eac5ffb4..84a95bf44 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -172,8 +172,13 @@ 'proxy_dest' => '/', 'proxy_pass' => [ { - 'path' => '/a', - 'url' => 'http://backend-a/' + 'path' => '/a', + 'url' => 'http://backend-a/', + 'keywords' => ['noquery', 'interpolate'], + 'params' => { + 'retry' => '0', + 'timeout' => '5' + } } ], 'suphp_addhandler' => 'foo', @@ -296,7 +301,12 @@ it { is_expected.to contain_concat__fragment('rspec.example.com-action') } it { is_expected.to contain_concat__fragment('rspec.example.com-block') } it { is_expected.to contain_concat__fragment('rspec.example.com-error_document') } - it { is_expected.to contain_concat__fragment('rspec.example.com-proxy') } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /retry=0/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /timeout=5/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /noquery interpolate/) } it { is_expected.to contain_concat__fragment('rspec.example.com-rack') } it { is_expected.to contain_concat__fragment('rspec.example.com-redirect') } it { is_expected.to contain_concat__fragment('rspec.example.com-rewrite') } diff --git a/tests/vhost_proxypass.pp b/tests/vhost_proxypass.pp index 968de4195..e911f85f9 100644 --- a/tests/vhost_proxypass.pp +++ b/tests/vhost_proxypass.pp @@ -9,37 +9,40 @@ # Most basic vhost with proxy_pass apache::vhost { 'first.example.com': - port => 80, - docroot => '/var/www/first', - proxy_pass => [ + port => 80, + docroot => '/var/www/first', + proxy_pass => [ { - 'path' => '/first', - 'url' => "http://localhost:8080/first" + 'path' => '/first', + 'url' => 'http://localhost:8080/first' }, ], } # vhost with proxy_pass and parameters apache::vhost { 'second.example.com': - port => 80, - docroot => '/var/www/second', - proxy_pass => [ + port => 80, + docroot => '/var/www/second', + proxy_pass => [ { 'path' => '/second', - 'url' => "http://localhost:8080/second", - 'params' => {'retry' => '0', 'timeout' => '5'} + 'url' => 'http://localhost:8080/second', + 'params' => { + 'retry' => '0', + 'timeout' => '5' + } }, ], } # vhost with proxy_pass and keywords apache::vhost { 'third.example.com': - port => 80, - docroot => '/var/www/third', - proxy_pass => [ + port => 80, + docroot => '/var/www/third', + proxy_pass => [ { - 'path' => '/third', - 'url' => "http://localhost:8080/third", + 'path' => '/third', + 'url' => 'http://localhost:8080/third', 'keywords' => ['noquery', 'interpolate'] }, ], @@ -47,14 +50,17 @@ # vhost with proxy_pass, parameters and keywords apache::vhost { 'fourth.example.com': - port => 80, - docroot => '/var/www/fourth', - proxy_pass => [ + port => 80, + docroot => '/var/www/fourth', + proxy_pass => [ { - 'path' => '/fourth', - 'url' => "http://localhost:8080/fourth", - 'params' => {'retry' => '0', 'timeout' => '5'}, + 'path' => '/fourth', + 'url' => 'http://localhost:8080/fourth', + 'params' => { + 'retry' => '0', + 'timeout' => '5' + }, 'keywords' => ['noquery', 'interpolate'] }, ], -} \ No newline at end of file +}