Skip to content

Commit a0b873e

Browse files
sdelanodanielsdeleo
authored andcommitted
feature tests for CHEF-1607
1 parent eda7068 commit a0b873e

15 files changed

Lines changed: 225 additions & 1 deletion

File tree

‎cucumber.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default: -f pretty features -r features/steps -r features/support
22
api: --tags @api --format pretty -r features/steps -r features/support features
33
api_cookbooks: --tags @api --tags @cookbooks --format pretty -r features/steps -r features/support features
44
api_cookbooks_list: --tags @api_cookbooks_list --format pretty -r features/steps -r features/support features
5-
api_cookbooks_show: --tags @spi_cookbooks_show --format pretty -r features/steps -r features/support features
5+
api_cookbooks_show: --tags @api_cookbooks_show --format pretty -r features/steps -r features/support features
66
api_cookbooks_upload: --tags @api_cookbooks_upload --format pretty -r features/steps -r features/support features
77
api_cookbooks_download: --tags @api_cookbooks_download --format pretty -r features/steps -r features/support features
88
api_cookbooks_delete: --tags @api_cookbooks_delete --format pretty -r features/steps -r features/support features

‎features/api/cookbooks/list_cookbooks.feature‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ Feature: List cookbooks via the REST API
3333
| an administrator |
3434
| a non-admin |
3535

36+
@CHEF-1607
37+
Scenario: List all cookbooks with the lastest version, when they cannot be lexically sorted
38+
Given I am an administrator
39+
And I upload multiple versions of the 'version_test' cookbook that do not lexically sort correctly
40+
When I 'GET' the path '/cookbooks/_latest'
41+
And the inflated responses key 'version_test' should match 'http://.+/cookbooks/version_test/0\.10\.0'
42+
3643
Scenario: List cookbooks with a wrong private key
3744
Given I am an administrator
3845
When I 'GET' the path '/cookbooks' using a wrong private key

‎features/api/cookbooks/show_cookbooks.feature‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ Feature: Show a cookbook via the REST API
2121
Then the inflated response should respond to 'templates' and match '^\[\]$' as json
2222
Then the inflated response should respond to 'resources' and match '^\[\]$' as json
2323

24+
@CHEF-1607
25+
Scenario: Show the latest version of a cookbook
26+
Given I am an administrator
27+
And I upload multiple versions of the 'version_test' cookbook that do not lexically sort correctly
28+
When I 'GET' the path '/cookbooks/version_test/_latest'
29+
Then the inflated response should respond to 'version' and match '0.10.0'
30+
2431
@show_cookbook_negative
2532
Scenario: Show a cookbook with a wrong private key
2633
Given I am an administrator

‎features/api/nodes/cookbook_sync_api.feature‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ Feature: Synchronize cookbooks to the edge
1818
And the inflated responses key 'node_cookbook_sync' should match '"attributes":' as json
1919
And the inflated responses key 'node_cookbook_sync' should match 'attr_file.rb' as json
2020

21+
@CHEF-1607
22+
Scenario: Retrieve the correct versions of cookbook files to sync, especially when they do not lexically sort
23+
Given I am an administrator
24+
And I upload multiple versions of the 'version_test' cookbook that do not lexically sort correctly
25+
And a 'node' named 'paradise' exists
26+
When I 'GET' the path '/nodes/paradise/cookbooks'
27+
And the inflated responses key 'version_test' should exist
28+
And the inflated responses key 'version_test' should match '"version":"0.10.0"' as json
29+
2130
Scenario: Retrieve the list of cookbook files to synchronize with a wrong private key
2231
Given I am an administrator
2332
And a 'node' named 'sync' exists
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "0.10.0",
3+
"suggestions": {
4+
5+
},
6+
"conflicting": {
7+
8+
},
9+
"license": "Apache 2.0",
10+
"providing": {
11+
12+
},
13+
"maintainer": "Opscode",
14+
"replacing": {
15+
16+
},
17+
"platforms": {
18+
19+
},
20+
"description": "Tests cookbook versioning in environments",
21+
"recipes": {
22+
23+
},
24+
"maintainer_email": "do_not_reply@opscode.com",
25+
"name": "version_test",
26+
"groupings": {
27+
28+
},
29+
"attributes": {
30+
31+
},
32+
"long_description": "",
33+
"recommendations": {
34+
35+
},
36+
"dependencies": {
37+
38+
}
39+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name "version_test"
2+
maintainer "Opscode"
3+
maintainer_email "do_not_reply@opscode.com"
4+
license "Apache 2.0"
5+
description "Tests cookbook versioning in environments"
6+
version "0.10.0"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Cookbook Name:: template
3+
# Recipe:: default
4+
#
5+
# Copyright 2010, Opscode, Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "0.9.0",
3+
"suggestions": {
4+
5+
},
6+
"conflicting": {
7+
8+
},
9+
"license": "Apache 2.0",
10+
"providing": {
11+
12+
},
13+
"maintainer": "Opscode",
14+
"replacing": {
15+
16+
},
17+
"platforms": {
18+
19+
},
20+
"description": "Tests cookbook versioning in environments",
21+
"recipes": {
22+
23+
},
24+
"maintainer_email": "do_not_reply@opscode.com",
25+
"name": "version_test",
26+
"groupings": {
27+
28+
},
29+
"attributes": {
30+
31+
},
32+
"long_description": "",
33+
"recommendations": {
34+
35+
},
36+
"dependencies": {
37+
38+
}
39+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name "version_test"
2+
maintainer "Opscode"
3+
maintainer_email "do_not_reply@opscode.com"
4+
license "Apache 2.0"
5+
description "Tests cookbook versioning in environments"
6+
version "0.9.0"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Cookbook Name:: template
3+
# Recipe:: default
4+
#
5+
# Copyright 2010, Opscode, Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#

0 commit comments

Comments
 (0)