nginx_proxy_spec.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. require 'spec_helper_acceptance'
  2. describe "nginx::resource::upstream define:" do
  3. it 'should run successfully' do
  4. pp = "
  5. class { 'nginx': }
  6. nginx::resource::upstream { 'puppet_rack_app':
  7. ensure => present,
  8. members => [
  9. 'localhost:3000',
  10. 'localhost:3001',
  11. 'localhost:3002',
  12. ],
  13. }
  14. nginx::resource::vhost { 'rack.puppetlabs.com':
  15. ensure => present,
  16. proxy => 'http://puppet_rack_app',
  17. }
  18. "
  19. apply_manifest(pp, :catch_failures => true)
  20. end
  21. describe file('/etc/nginx/conf.d/puppet_rack_app-upstream.conf') do
  22. it { should be_file }
  23. it { should contain "server localhost:3000" }
  24. it { should contain "server localhost:3001" }
  25. it { should contain "server localhost:3002" }
  26. it { should_not contain "server localhost:3003" }
  27. end
  28. describe file('/etc/nginx/sites-available/rack.puppetlabs.com.conf') do
  29. it { should be_file }
  30. it { should contain "proxy_pass http://puppet_rack_app;" }
  31. end
  32. end