1 describe package("nginx") do
2 it { should be_installed }
5 describe service("nginx") do
6 it { should be_enabled }
7 it { should be_running }
11 it { should be_listening }
12 its("protocols") { should cmp %w[tcp tcp6] }
16 it { should be_listening }
17 its("protocols") { should cmp %w[tcp tcp6] }
20 describe http("http://localhost") do
21 its("status") { should cmp 301 }
24 describe http("https://localhost", :ssl_verify => false) do
25 its("status") { should cmp 200 }
28 describe http("https://localhost/styles/shortbread/colorful.json", :ssl_verify => false) do
29 its("status") { should cmp 200 }
30 its("headers") { should_not include "Access-Control-Allow-Origin" }
31 its("headers.vary") { should cmp "Origin" }
34 describe http("https://localhost/styles/shortbread/colorful.json", :headers => { "Origin" => "https://www.openstreetmap.org" }, :ssl_verify => false) do
35 its("status") { should cmp 200 }
36 its("headers.Access-Control-Allow-Origin") { should cmp "https://www.openstreetmap.org" }
37 its("headers.vary") { should cmp "Origin" }
40 describe json(:content => http("https://localhost/styles/shortbread/colorful.json", :ssl_verify => false).body) do
41 its(%w[sources versatiles-shortbread tiles]) do
42 should eq(["https://vector.openstreetmap.org/shortbread_v1/{z}/{x}/{y}.mvt"])
44 its(["sprite", 0, "url"]) { should match %r{https://vector.openstreetmap.org/} }
45 its(["glyphs"]) { should match %r{https://vector.openstreetmap.org/} }