module-nginx/spec/system/nginx_mail_spec.rb
Ashley Penney 52e6aa49c7 Add basic rspec-system tests.
This adds some really basic system tests so that we can test that
various refactorings work correctly and make life easier for you
before submitting.
2013-09-04 15:11:36 -04:00

38 lines
986 B
Ruby

require 'spec_helper_system'
describe "nginx::resource::mailhost define:" do
context 'should run successfully' do
pp = "
class { 'nginx':
mail => true,
}
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
}
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'localhost/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl_port => 465,
xclient => 'off',
}
"
context puppet_apply(pp) do
its(:exit_code) { should_not == 1 }
its(:refresh) { should be_nil }
# Not until deprecated variables fixed.
#its(:stderr) { should be_empty }
its(:exit_code) { should be_zero }
end
end
describe file('/etc/nginx/conf.mail.d/vhost_autogen.conf') do
it { should be_file }
it { should contain "auth_http localhost/cgi-bin/auth;" }
end
end