fixed role name new field validators without validate fields types fixed error with user parser todo: project tests returned some tests, users fixed some more tests: filters images tests network tests keys tests test generator fixed run_list validator
86 lines
2.9 KiB
Plaintext
86 lines
2.9 KiB
Plaintext
@image @project
|
|
Feature: Manage images
|
|
|
|
<% providers = @formatter.get_fixture('providers/without_static') %>
|
|
<% providers.each do |provider| %>
|
|
<% other_providers = providers.clone - [provider] %>
|
|
<% other_providers.each do |oprovider| %>
|
|
@<%= provider %>
|
|
Scenario: Create <%= provider %> image with '<%= oprovider %>' provider (invalid image id for provider)
|
|
When I send POST '/v2.0/image' query with JSON body
|
|
"""
|
|
<%= @formatter.json(provider + '/image', {value: {"provider" => oprovider}}) %>
|
|
"""
|
|
Then response should be '400'
|
|
|
|
<% end #other providers%>
|
|
<% image = @formatter.get_fixture(provider + '/image') %>
|
|
<% image.keys.each do |key| %>
|
|
<% [[], {}].each do |invalid_value| %>
|
|
@<%= provider %>
|
|
Scenario: Create <%= provider %> image with invalid <%= key %> value: '<%= invalid_value %>'
|
|
When I send POST '/v2.0/image' query with JSON body
|
|
"""
|
|
<%= @formatter.json(provider + '/image', {value: {key => invalid_value}}) %>
|
|
"""
|
|
Then response should be '400'
|
|
|
|
<% end #invalid values%>
|
|
|
|
<% end # keys%>
|
|
<% (image.keys - ["bootstrap_template"]).each do |key| %>
|
|
@<%= provider %>
|
|
Scenario: Create <%= provider %> image with invalid <%= key %> value: 'nil'
|
|
When I send POST '/v2.0/image' query with JSON body
|
|
"""
|
|
<%= @formatter.json(provider + '/image', {value: {key => nil}}) %>
|
|
"""
|
|
Then response should be '400'
|
|
|
|
<% end %>
|
|
|
|
<% (image.keys - ["name", "remote_user"]).each do |key| %>
|
|
@<%= provider %>
|
|
Scenario: Create <%= provider %> image with invalid <%= key %> value: 'foo'
|
|
When I send POST '/v2.0/image' query with JSON body
|
|
"""
|
|
<%= @formatter.json(provider + '/image', {value: {key => "foo"}}) %>
|
|
"""
|
|
Then response should be '400'
|
|
|
|
<% end %>
|
|
|
|
@<%= provider %>
|
|
Scenario: Create <%= provider %> image
|
|
When I send POST '/v2.0/image' query with JSON body
|
|
"""
|
|
<%= @formatter.json(provider + '/image') %>
|
|
"""
|
|
Then response should be '201'
|
|
And the Content-Type header should include 'application/json'
|
|
|
|
@<%= provider %>
|
|
Scenario: Check new <%= provider %> image
|
|
When I send GET '/v2.0/image/<%= image["id"] %>' query
|
|
Then response should be '200'
|
|
And the Content-Type header should include 'application/json'
|
|
And the JSON response should be an object
|
|
And response should be JSON object like:
|
|
"""
|
|
<%= @formatter.json(provider + '/image') %>
|
|
"""
|
|
|
|
@<%= provider %>
|
|
Scenario: Get <%= provider %> image without privileges
|
|
When I send GET '/v2.0/image/<%= image["id"] %>' query with user without privileges
|
|
Then response should be '401'
|
|
|
|
@<%= provider %>
|
|
Scenario: Get list of <%= provider %> images with header 'Accept' value is not 'application/json'
|
|
When I send GET '/v2.0/image/<%= image["id"] %>' query with header 'Accept' value 'application/xml'
|
|
Then response should be '406'
|
|
|
|
<% end %>
|
|
|
|
|