diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/api/cookbooks/list_cookbooks.feature | 19 | ||||
-rw-r--r-- | features/api/environments/list_environment_cookbooks_api.feature | 9 | ||||
-rw-r--r-- | features/steps/fixture_steps.rb | 7 |
3 files changed, 19 insertions, 16 deletions
diff --git a/features/api/cookbooks/list_cookbooks.feature b/features/api/cookbooks/list_cookbooks.feature index 49b5e36b74..b698e62a3b 100644 --- a/features/api/cookbooks/list_cookbooks.feature +++ b/features/api/cookbooks/list_cookbooks.feature @@ -28,26 +28,13 @@ Feature: List cookbooks via the REST API | an administrator | | a non-admin | - Scenario Outline: List all cookbooks with the latest version - Given I am <user_type> - And I upload multiple versions of the 'version_test' cookbook - When I 'GET' the path '/cookbooks/_latest' - And the inflated responses key 'attribute_include' should match 'http://.+/cookbooks/attribute_include/0\.1\.0' - And the inflated responses key 'deploy' should match 'http://.+/cookbooks/deploy/0\.0\.0' - And the inflated responses key 'metadata' should match 'http://.+/cookbooks/metadata/1\.0\.0' - And the inflated responses key 'version_test' should match 'http://.+/cookbooks/version_test/0\.2\.0' - - Examples: - | user_type | - | an administrator | - | a non-admin | - @CHEF-1607 Scenario: List all cookbooks with the lastest version, when they cannot be lexically sorted Given I am an administrator And I upload multiple versions of the 'version_test' cookbook that do not lexically sort correctly - When I 'GET' the path '/cookbooks/_latest' - And the inflated responses key 'version_test' should match 'http://.+/cookbooks/version_test/0\.10\.0' + When I 'GET' the path '/cookbooks?num_versions=all' + Then the inflated responses key 'version_test' sub-key 'versions' should be '3' items long + And the inflated responses key 'version_test' sub-key 'versions' item '0' sub-key 'version' should equal '0.10.0' Scenario: List cookbooks with a wrong private key Given I am an administrator diff --git a/features/api/environments/list_environment_cookbooks_api.feature b/features/api/environments/list_environment_cookbooks_api.feature index 062f44d2d2..10f8cb07e7 100644 --- a/features/api/environments/list_environment_cookbooks_api.feature +++ b/features/api/environments/list_environment_cookbooks_api.feature @@ -29,6 +29,15 @@ Feature: List cookbook versions for an environment via the REST API | an administrator | | a non-admin | + @CHEF-1607 + Scenario: List all cookbooks with the lastest version, when they cannot be lexically sorted + Given I am an administrator + And I upload multiple versions of the 'version_test' cookbook that do not lexically sort correctly + And an 'environment' named 'chef-1607' exists + When I 'GET' the path '/environments/chef-1607/cookbooks?num_versions=all' + Then the inflated responses key 'version_test' sub-key 'versions' should be '3' items long + And the inflated responses key 'version_test' sub-key 'versions' item '0' sub-key 'version' should equal '0.10.0' + Scenario Outline: List cookbook versions for an environment should restrict only the specified cookbooks Given I am an administrator And I upload multiple versions of the 'version_test' cookbook diff --git a/features/steps/fixture_steps.rb b/features/steps/fixture_steps.rb index 4317141ee9..0a137662e4 100644 --- a/features/steps/fixture_steps.rb +++ b/features/steps/fixture_steps.rb @@ -252,6 +252,13 @@ Before do e.cookbook 'version_test', '> 0.1.0' e end, + 'chef-1607' => Proc.new do + e = Chef::Environment.new + e.name 'chef-1607' + e.description 'test cookbook version constraints' + e.cookbook 'version_test', '> 0.0.0' + e + end, 'cookbooks-0.1.0' => Proc.new do e = Chef::Environment.new e.name 'cookbooks_test' |