Skip to content

Commit 3ecc2e8

Browse files
author
Christopher Brown
committed
adding spec tests
1 parent f79a738 commit 3ecc2e8

5 files changed

Lines changed: 96 additions & 16 deletions

File tree

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
22

3-
describe "/cookbooks" do
4-
before(:each) do
5-
@response = request("/cookbooks")
3+
describe "/chefserverslice/" do
4+
5+
before(:all) do
6+
mount_slice
67
end
7-
end
8+
9+
describe "GET /" do
10+
11+
before(:each) do
12+
@response = request("/chefserverslice/")
13+
end
14+
15+
it "should be successful" do
16+
@response.status.should be_successful
17+
end
18+
19+
# This is just an example of what you can do
20+
# You can also use the other webrat methods to click links,
21+
# fill up forms etc...
22+
it "should render the default slice layout" do
23+
@response.should have_tag(:title, :content => "Chef Server")
24+
end
25+
26+
end
27+
28+
after(:all) do
29+
dismount_slice
30+
end
31+
32+
end

chefserverslice/spec/requests/main_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
end
2525

2626
end
27+
28+
after(:all) do
29+
dismount_slice
30+
end
2731

2832
end
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
22

3-
describe "/nodes" do
4-
before(:each) do
5-
@response = request("/nodes")
3+
describe "/chefserverslice/nodes/" do
4+
5+
before(:all) do
6+
mount_slice
67
end
7-
end
8+
9+
describe "GET /" do
10+
before(:each) do
11+
@response = request("/chefserverslice/nodes/")
12+
end
13+
14+
it "should be successful" do
15+
@response.status.should be_successful
16+
end
17+
end
18+
19+
after(:all) do
20+
dismount_slice
21+
end
22+
23+
end
Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
22

3-
describe "/openid_register" do
4-
before(:each) do
5-
@response = request("/openid_register")
3+
describe "/chefserverslice/openid_register" do
4+
5+
before(:all) do
6+
mount_slice
67
end
7-
end
8+
9+
describe "GET /" do
10+
before(:each) do
11+
@response = request("/chefserverslice/registrations")
12+
end
13+
14+
it "should be successful" do
15+
@response.status.should be_successful
16+
end
17+
18+
it "should have registered nodes list" do
19+
@response.should have_tag(:h3, :content=>"Registered OpenID Nodes List")
20+
end
21+
end
22+
23+
after(:all) do
24+
dismount_slice
25+
end
26+
27+
end
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
22

3-
describe "/search" do
4-
before(:each) do
5-
@response = request("/search")
3+
describe "/chefserverslice/search/" do
4+
before(:all) do
5+
mount_slice
66
end
7-
end
7+
8+
describe "GET /" do
9+
before(:each) do
10+
@response = request("/chefserverslice/search/")
11+
end
12+
13+
it "should be successful" do
14+
@response.status.should be_successful
15+
end
16+
end
17+
18+
after(:all) do
19+
dismount_slice
20+
end
21+
22+
end

0 commit comments

Comments
 (0)