module-nginx/spec/acceptance/nginx_mail_spec.rb

40 lines
915 B
Ruby
Raw Normal View History

require 'spec_helper_acceptance'
describe "nginx::resource::mailhost define:" do
it 'should run successfully' do
pp = "
class { 'nginx':
mail => true,
}
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'localhost/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
2015-04-09 16:44:07 +02:00
ssl => true,
ssl_port => 465,
2015-04-09 16:44:07 +02:00
ssl_cert => '/tmp/blah.cert',
ssl_key => '/tmp/blah.key',
xclient => 'off',
}
"
apply_manifest(pp, :catch_failures => true)
end
describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
it { is_expected.to be_file }
it { is_expected.to contain "auth_http localhost/cgi-bin/auth;" }
end
2015-04-09 16:44:07 +02:00
describe port(587) do
it { is_expected.to be_listening }
end
describe port(465) do
it { is_expected.to be_listening }
end
end