diff options
author | sdelano <stephen@opscode.com> | 2010-08-18 00:41:57 -0700 |
---|---|---|
committer | sdelano <stephen@opscode.com> | 2010-08-26 13:19:11 -0700 |
commit | b058bb7ac8f63316e02c64752945c683d5d6f6eb (patch) | |
tree | d32df9a3bd05466603fcb1da7dbf6efb28e135af | |
parent | 3f03fa589e39a615c7cbc0962c1988c8eb8c342d (diff) | |
download | chef-b058bb7ac8f63316e02c64752945c683d5d6f6eb.tar.gz |
rename/rearrange cookbooks api feature tests
-rw-r--r-- | Rakefile | 11 | ||||
-rw-r--r-- | cucumber.yml | 7 | ||||
-rw-r--r-- | features/api/cookbooks/delete_cookbooks.feature | 2 | ||||
-rw-r--r-- | features/api/cookbooks/download_cookbooks.feature | 2 | ||||
-rw-r--r-- | features/api/cookbooks/list_cookbooks.feature | 25 | ||||
-rw-r--r-- | features/api/cookbooks/show_cookbooks.feature (renamed from features/api/cookbooks/showlist_cookbooks.feature) | 18 | ||||
-rw-r--r-- | features/api/cookbooks/upload_cookbooks.feature | 2 |
7 files changed, 48 insertions, 19 deletions
@@ -338,10 +338,15 @@ begin end end + desc "Run cucumber tests for the cookbooks portion of the REST API" + Cucumber::Rake::Task.new(:cookbooks) do |t| + t.profile = "api_cookbooks" + end namespace :cookbooks do - desc "Run cucumber tests for the cookbooks portion of the REST API" - Cucumber::Rake::Task.new(:cookbooks) do |t| - t.profile = "api_cookbooks" + %w{list show upload download delete}.each do |action| + Cucumber::Rake::Task.new(action) do |t| + t.profile = "api_cookbooks_#{action}" + end end Cucumber::Rake::Task.new(:cookbook_tarballs) do |t| diff --git a/cucumber.yml b/cucumber.yml index 64751600df..65804844dd 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -1,6 +1,11 @@ default: -f pretty features -r features/steps -r features/support api: --tags @api --format pretty -r features/steps -r features/support features -api_cookbooks: --tags @api --tags @cookbooks --format pretty -r features/steps -r features/support features +api_cookbooks: --tags @api --tags @cookbooks --format pretty -r features/steps -r features/support features +api_cookbooks_list: --tags @api_cookbooks_list --format pretty -r features/steps -r features/support features +api_cookbooks_show: --tags @spi_cookbooks_show --format pretty -r features/steps -r features/support features +api_cookbooks_upload: --tags @api_cookbooks_upload --format pretty -r features/steps -r features/support features +api_cookbooks_download: --tags @api_cookbooks_download --format pretty -r features/steps -r features/support features +api_cookbooks_delete: --tags @api_cookbooks_delete --format pretty -r features/steps -r features/support features api_cookbooks_tarballs: --tags @api --tags @cookbooks --tags @tarballs --format pretty -r features/steps -r features/support features api_clients: --tags @api_clients --format pretty -r features/steps -r features/support features api_clients_create: --tags @clients_create --format pretty -r features/steps -r features/support features diff --git a/features/api/cookbooks/delete_cookbooks.feature b/features/api/cookbooks/delete_cookbooks.feature index 98b8a0227e..e661c08711 100644 --- a/features/api/cookbooks/delete_cookbooks.feature +++ b/features/api/cookbooks/delete_cookbooks.feature @@ -1,4 +1,4 @@ -@api @cookbooks +@api @cookbooks @api_cookbooks_delete @manage_cookbook Feature: CRUD cookbooks diff --git a/features/api/cookbooks/download_cookbooks.feature b/features/api/cookbooks/download_cookbooks.feature index b9e08d9075..cc3d2d8759 100644 --- a/features/api/cookbooks/download_cookbooks.feature +++ b/features/api/cookbooks/download_cookbooks.feature @@ -1,4 +1,4 @@ -@api @cookbooks +@api @cookbooks @api_cookbooks_download @manage_cookbook Feature: CRUD cookbooks diff --git a/features/api/cookbooks/list_cookbooks.feature b/features/api/cookbooks/list_cookbooks.feature new file mode 100644 index 0000000000..5a86d34bd4 --- /dev/null +++ b/features/api/cookbooks/list_cookbooks.feature @@ -0,0 +1,25 @@ +@api @cookbooks @api_cookbooks_list + +Feature: List cookbooks via the REST API + In order to know what cookbooks are available + As a developer + I want to be able to list all cookbooks via the REST API + + Scenario Outline: List all cookbooks + Given I am <user_type> + And I upload multiple versions of the 'version_test' cookbook + When I 'GET' the path '/cookbooks' + 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 | + + Scenario: List cookbooks with a wrong private key + Given I am an administrator + When I 'GET' the path '/cookbooks' using a wrong private key + Then I should get a '401 "Unauthorized"' exception
\ No newline at end of file diff --git a/features/api/cookbooks/showlist_cookbooks.feature b/features/api/cookbooks/show_cookbooks.feature index 1b7b486933..dbd6bc47d1 100644 --- a/features/api/cookbooks/showlist_cookbooks.feature +++ b/features/api/cookbooks/show_cookbooks.feature @@ -1,11 +1,11 @@ -@api @cookbooks @show_cookbook -Feature: Show a cookbook via the REST API - In order to know what the details are for a cookbook +@api @cookbooks @api_cookbooks_show +Feature: Show a cookbook via the REST API + In order to know what the details are for a cookbook As a Developer - I want to show the details for a specific cookbook - + I want to show the details for a specific cookbook + @show_cookbook - Scenario: Show a cookbook + Scenario: Show a cookbook Given I am an administrator When I fully upload a sandboxed cookbook named 'testcookbook_valid' versioned '0.1.0' with 'testcookbook_valid' Then I 'GET' the path '/cookbooks/testcookbook_valid/0.1.0' @@ -27,12 +27,6 @@ Feature: Show a cookbook via the REST API When I 'GET' the path '/cookbooks/show_cookbook' using a wrong private key Then I should get a '401 "Unauthorized"' exception - @list_cookbooks - Scenario: List cookbooks with a wrong private key - Given I am an administrator - When I 'GET' the path '/cookbooks' using a wrong private key - Then I should get a '401 "Unauthorized"' exception - @show_cookbook_negative Scenario: Listing versions for a non-existent cookbook should fail Given I am an administrator diff --git a/features/api/cookbooks/upload_cookbooks.feature b/features/api/cookbooks/upload_cookbooks.feature index cf9f51a66a..b6135f74c7 100644 --- a/features/api/cookbooks/upload_cookbooks.feature +++ b/features/api/cookbooks/upload_cookbooks.feature @@ -1,4 +1,4 @@ -@api @cookbooks +@api @cookbooks @api_cookbooks_upload @manage_cookbook Feature: CRUD cookbooks |