Conflicts:
	devops-service/tests/generate_tests.rb
This commit is contained in:
amartynov 2014-07-15 12:58:41 +04:00
commit 4e7472de3d
5 changed files with 27 additions and 7 deletions

View File

@ -41,7 +41,11 @@ templates = {
"templates/api_v2/10_create/30_script.feature.erb" => "features/api_v2/10_create/30_script.feature",
"templates/api_v2/10_create/00_user.feature.erb" => "features/api_v2/10_create/00_user.feature",
#update
"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",
"templates/api_v2/90_delete/90_user.feature.erb" => "features/api_v2/90_delete/90_user.feature"
}
generator = Generator.new

View File

@ -91,7 +91,7 @@ Feature: Filters
When I send PUT '/v2.0/filter/openstack/image' query with body
"""
[
"<%= @config["openstack"]["image"] %>"
"<%= @config["openstack"]["image"] %>",
]
"""
Then response should be '400'
@ -186,7 +186,7 @@ Feature: Filters
When I send PUT '/v2.0/filter/ec2/image' query with body
"""
[
"<%= @config["ec2"]["image"] %>"
"<%= @config["ec2"]["image"] %>",
]
"""
Then response should be '400'

View File

@ -515,7 +515,7 @@ Feature: Manage images
@ec2
Scenario: Get info for single ec2 image
When I send GET '<%= @config["ec2"]["image"] %>' query
When I send GET '/v2.0/image/<%= @config["ec2"]["image"] %>' query
Then response should be '200'
And the Content-Type header should include 'application/json'
And the JSON response should be an object
@ -532,12 +532,12 @@ Feature: Manage images
@ec2
Scenario: Get info for single ec2 image without headers 'Accept'
When I send GET '<%= @config["ec2"]["image"] %>' query without headers 'Accept'
When I send GET '/v2.0/image/<%= @config["ec2"]["image"] %>' query without headers 'Accept'
Then response should be '406'
@ec2
Scenario: Get ec2 image without privileges
When I send GET '<%= @config["ec2"]["image"] %>' query with user without privileges
When I send GET '/v2.0/image/<%= @config["ec2"]["image"] %>' query with user without privileges
Then response should be '401'
@openstack

View File

@ -13,7 +13,7 @@ Feature: create project
"expires": null,
"provider": "openstack",
"users": [
"<%= @config["user"] %>"
"<%= @config["username"] %>"
],
"flavor": "<%= @config["openstack"]["flavor"] %>",
"image": "<%= @config["openstack"]["image"] %>",
@ -42,7 +42,7 @@ Feature: create project
"expires": null,
"provider": "ec2",
"users": [
"<%= @config["user"] %>"
"<%= @config["username"] %>"
],
"flavor": "<%= @config["ec2"]["flavor"] %>",
"image": "<%= @config["ec2"]["image"] %>",

View File

@ -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