Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
abraham1901 committed Jan 21, 2014
2 parents 78bccdb + cb6cf8d commit c8e1921
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/defines/resource_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,18 @@

it { expect { should contain_class('nginx::resource::location') }.to raise_error(Puppet::Error, /Cannot define both directory and proxy in a virtual host/) }
end

context 'when vhost name is sanitized' do
let :title do 'www.rspec-location.com' end
let :params do {
:vhost => 'www rspec-vhost com',
:www_root => '/',
:ssl => true,
} end

it { should contain_concat__fragment("www_rspec-vhost_com-500-www.rspec-location.com").with_target('/etc/nginx/sites-available/www_rspec-vhost_com.conf') }
it { should contain_concat__fragment("www_rspec-vhost_com-800-www.rspec-location.com-ssl").with_target('/etc/nginx/sites-available/www_rspec-vhost_com.conf') }
end
end
end
end
7 changes: 7 additions & 0 deletions spec/defines/resource_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,13 @@
it { should contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_cgi_param test2 test value 2;/ ) }
it { should contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_cgi_param test3 test value 3;/ ) }
end

context 'when vhost name is sanitized' do
let :title do 'www rspec-vhost com' end
let :params do default_params end

it { should contain_concat('/etc/nginx/sites-available/www_rspec-vhost_com.conf') }
end
end
end
end

0 comments on commit c8e1921

Please sign in to comment.