Skip to content

Commit 6a723a9

Browse files
committed
Fix tests
1 parent d7d58db commit 6a723a9

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

test/integration/simple/serverspec/nginx_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535

3636
describe 'NGinx http content' do
3737

38-
describe command "curl -s -L http://127.0.0.1:1080 | grep h1" do
38+
describe command "curl -s -L http://127.0.0.1:1080" do
3939
its(:exit_status) { should eq 0 }
40-
its(:stdout) { should match "<h1>Welcome to nginx!</h1>" }
40+
its(:stdout) { should match "Hello test1" }
4141
end
4242
end
4343

test/integration/simple/simple.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,28 @@
1717
name: /,
1818
type: location,
1919
try_files: "$uri $uri/ /index.html",
20-
root: "{{ nginx_default_root }}"
20+
root: "/nginx/test1/"
2121
}
22-
## Use yaml
23-
location2 :
24-
name : /doc/
25-
type : location
26-
alias : "/usr/share/doc/"
27-
autoindex : "on"
28-
allow : "127.0.0.2"
29-
deny : "all"
3022
pre_tasks:
3123
- name: update apt
3224
apt: update_cache=yes cache_valid_time=3600
3325

26+
- name: Create dir for content
27+
file:
28+
path="/nginx/{{ item }}"
29+
state=directory
30+
mode=0755
31+
with_items:
32+
- test1
33+
34+
- name: Create content for test
35+
copy:
36+
content="Hello {{ item }}"
37+
dest="/nginx/{{ item }}/index.html"
38+
mode=0644
39+
with_items:
40+
- test1
41+
3442
roles :
3543
- "ansible-nginx"
3644

0 commit comments

Comments
 (0)