blob: 72da73f14aac4a31684a5e85102396e26d1cee3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
describe "stronglifters::nginx" do
let(:domain) { "www.example.com" }
subject do
ChefSpec::SoloRunner.new do |node|
node.set["nginx"]["domain"] = domain
end.converge(described_recipe)
end
it "installs nginx" do
expect(subject).to install_package("nginx")
end
it "copies the ssl certificate" do
expect(subject).to create_file("/etc/ssl/certs/#{domain}.crt")
end
it "copies the ssl private key" do
expect(subject).to create_file("/etc/ssl/private/#{domain}.key")
end
it "adds the configuration for the website" do
expect(subject).to create_template("/etc/nginx/nginx.conf")
end
it "restarts nginx" do
resource = subject.template("/etc/nginx/nginx.conf")
expect(resource).to notify("service[nginx]").to(:restart).delayed
end
it "starts nginx" do
expect(subject).to start_service("nginx")
end
it "creates the log directory for nginx" do
expect(subject).to create_directory("/var/log/nginx")
end
it "adds the logrotate config for rotating nginx logs" do
expect(subject).to create_template("/etc/logrotate.d/nginx")
end
end
|