From f8efb31aa31fe33efa327587fcdc12e497188950 Mon Sep 17 00:00:00 2001 From: Tim Lianov Date: Tue, 15 Jul 2014 12:22:51 +0400 Subject: [PATCH] added delete script template --- devops-service/tests/generate_tests.rb | 5 ++++- .../api_v2/90_delete/10_script.feature.erb | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 devops-service/tests/templates/api_v2/90_delete/10_script.feature.erb diff --git a/devops-service/tests/generate_tests.rb b/devops-service/tests/generate_tests.rb index 11cbc46..3f2c9ad 100755 --- a/devops-service/tests/generate_tests.rb +++ b/devops-service/tests/generate_tests.rb @@ -41,7 +41,10 @@ templates = { "templates/api_v2/10_create/30_script.feature.erb" => "features/api_v2/10_create/30_script.feature", #update - "templates/api_v2/20_update/10_image.feature.erb" => "features/api_v2/20_update/10_image.feature" + "templates/api_v2/20_update/10_image.feature.erb" => "features/api_v2/20_update/10_image.feature", + + #delete + "templates/api_v2/90_delete/10_script.feature.erb" => "features/api_v2/90_delete/10_script.feature" } generator = Generator.new diff --git a/devops-service/tests/templates/api_v2/90_delete/10_script.feature.erb b/devops-service/tests/templates/api_v2/90_delete/10_script.feature.erb new file mode 100644 index 0000000..1d57931 --- /dev/null +++ b/devops-service/tests/templates/api_v2/90_delete/10_script.feature.erb @@ -0,0 +1,16 @@ +@script +Feature: Delete script + + Scenario: Delete script with user without privileges + When I send DELETE '/v2.0/script/<%= @config["script"]["name"] %>' query with user without privileges + Then response should be '401' + + Scenario: Delete script without header 'Accept' + When I send DELETE '/v2.0/script/<%= @config["script"]["name"] %>' query without header 'Accept' + Then response should be '406' + + Scenario: Delete script with id '<%= @config["script"]["name"] %>' + When I send DELETE '/v2.0/script/<%= @config["script"]["name"] %>' query + Then response should be '200' + And the Content-Type header should include 'application/json' + And the JSON response should be an object