add tests for deploy envs validation

This commit is contained in:
Anton Chuchkalov 2014-11-26 19:20:58 +04:00
parent 574c485c3d
commit 638bf26003
2 changed files with 146 additions and 4 deletions

View File

@ -1,13 +1,14 @@
@project @deploy_env @project @deploy_env
Feature: Delete deploy env Feature: Create deploy env
@static
<% project_name = @config["static"]["project"]["name"] %> <% project_name = @config["static"]["project"]["name"] %>
Scenario: Delete deploy env for project <%= project_name %> @static
Scenario: Send deploy env with invalid runlist for project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
""" """
{ {
"deploy_envs": [ "deploy_envs": [
// precreated deploy env
{ {
"identifier": "test", "identifier": "test",
"run_list": [], "run_list": [],
@ -16,6 +17,147 @@ Feature: Delete deploy env
"users": [ "users": [
"test" "test"
] ]
},
// new deploy env
{
"identifier": "test2",
"run_list": [
"wrongrole[test2_t2]"
],
"expires": null,
"provider": "static",
"users": [
"test"
]
}
],
"name": "<%= project_name %>"
}
"""
Then response should be '400'
@static
Scenario: Send deploy env with invalid expiration for project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
"""
{
"deploy_envs": [
// precreated deploy env
{
"identifier": "test",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"test"
]
},
// new deploy env
{
"identifier": "test2",
"run_list": [],
"expires": "10asd",
"provider": "static",
"users": [
"test"
]
}
],
"name": "<%= project_name %>"
}
"""
Then response should be '400'
@static
Scenario: Send deploy env with invalid expiration for project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
"""
{
"deploy_envs": [
// precreated deploy env
{
"identifier": "test",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"test"
]
},
// new deploy env
{
"identifier": "test2",
"run_list": [],
"expires": "10asd",
"provider": "static",
"users": [
"test"
]
}
],
"name": "<%= project_name %>"
}
"""
Then response should be '400'
@static
Scenario: Send deploy env with invalid user (not present in mongo) for project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
"""
{
"deploy_envs": [
// precreated deploy env
{
"identifier": "test",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"test"
]
},
// new deploy env
{
"identifier": "test2",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"non_existing_user"
]
}
],
"name": "<%= project_name %>"
}
"""
Then response should be '400'
@static
Scenario: Create deploy env for project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
"""
{
"deploy_envs": [
// precreated deploy env
{
"identifier": "test",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"test"
]
},
// new deploy env
{
"identifier": "test2",
"run_list": [],
"expires": null,
"provider": "static",
"users": [
"test"
]
} }
], ],
"name": "<%= project_name %>" "name": "<%= project_name %>"

View File

@ -3,7 +3,7 @@ Feature: Delete deploy env
@static @static
<% project_name = @config["static"]["project"]["name"] %> <% project_name = @config["static"]["project"]["name"] %>
Scenario: Delete deploy env for project <%= project_name %> Scenario: Delete deploy env of project <%= project_name %>
When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body When I send PUT '/v2.0/project/<%= project_name %>' query with JSON body
""" """
{ {