1 require 'spec_helper_acceptance'
3 describe 'apache::mod::negotiation class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
6 vhost_dir = '/etc/apache2/sites-enabled'
7 mod_dir = '/etc/apache2/mods-available'
8 service_name = 'apache2'
10 vhost_dir = '/etc/httpd/conf.d'
11 mod_dir = '/etc/httpd/conf.d'
12 service_name = 'httpd'
14 vhost_dir = '/usr/local/etc/apache24/Vhosts'
15 mod_dir = '/usr/local/etc/apache24/Modules'
16 service_name = 'apache24'
18 vhost_dir = '/etc/apache2/vhosts.d'
19 mod_dir = '/etc/apache2/modules.d'
20 service_name = 'apache2'
23 context "default negotiation config" do
24 it 'succeeds in puppeting negotiation' do
26 class { '::apache': default_mods => false }
27 class { '::apache::mod::negotiation': }
29 apply_manifest(pp, :catch_failures => true)
32 describe file("#{mod_dir}/negotiation.conf") do
33 it { should contain "LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
34 ForceLanguagePriority Prefer Fallback" }
37 describe service(service_name) do
38 it { should be_enabled }
39 it { should be_running }
43 context "with alternative force_language_priority" do
44 it 'succeeds in puppeting negotiation' do
46 class { '::apache': default_mods => false }
47 class { '::apache::mod::negotiation':
48 force_language_priority => 'Prefer',
51 apply_manifest(pp, :catch_failures => true)
54 describe file("#{mod_dir}/negotiation.conf") do
55 it { should contain "ForceLanguagePriority Prefer" }
58 describe service(service_name) do
59 it { should be_enabled }
60 it { should be_running }
64 context "with alternative language_priority" do
65 it 'succeeds in puppeting negotiation' do
67 class { '::apache': default_mods => false }
68 class { '::apache::mod::negotiation':
69 language_priority => [ 'en', 'es' ],
72 apply_manifest(pp, :catch_failures => true)
75 describe file("#{mod_dir}/negotiation.conf") do
76 it { should contain "LanguagePriority en es" }
79 describe service(service_name) do
80 it { should be_enabled }
81 it { should be_running }