fluke/devops-service/features/api_v2/image.feature
2014-07-02 11:45:02 +04:00

49 lines
1.4 KiB
Gherkin

@image
Feature: Manage images
Scenario: Get list of all images
When I send GET '/v2.0/images' query
Then response should be '200'
And the Content-Type header should include 'application/json'
And the JSON response should be an array
And response array should contains elements like:
"""
[
{
"provider": "foo_provider",
"name": "foo_name",
"remote_user": "foo_user",
"bootstrap_template": "foo_template",
"id": "foo_id"
}
]
"""
Scenario: Get info for single image
When I send GET '/v2.0/image/ami-83e4bcea' query
Then response should be '200'
And the Content-Type header should include 'application/json'
And the JSON response should be a hash
And response should be JSON object like:
"""
{
"provider": "foo_provider",
"name": "foo_name",
"remote_user": "foo_user",
"bootstrap_template": "foo_template",
"id": "b79994de"
}
"""
Scenario: Get images list without privileges
When I send GET '/v2.0/images' query with user without privileges
Then response should be '401'
Scenario: Get image without privileges
When I send GET '/v2.0/image/ami-83e4bcea' query with user without privileges
Then response should be '401'
Scenario: Get unknown image
When I send GET '/v2.0/image/foo' query
Then response should be '404'