@project @environment @create
Feature: Update deploy environment
<% project = @formatter.get_fixture('project/new') %>
<% environment = @formatter.get_fixture('project/environment') %>
<% @formatter.get_fixture('providers/all').each do |provider| %>

  <% generate_mandatory_fields_validation "POST", "Add category for provider #{provider}", "/v3/project/#{project["id"]}/environment/#{environment["id"]}/category", @formatter.get_fixture(provider + '/category'), @formatter.get_fixture(provider + '/category_mandatory_fields'), provider %>
  <% generate_modify_path_scenarios "POST", "Add category for provider #{provider}", "/v3/project/#{project["id"]}/environment/#{environment["id"]}/category", @formatter.get_fixture(provider + '/category'), provider do %>
  <% end %>

  @<%= provider %>
  Scenario: Add category for provider <%= provider %>, second time
    When I send POST '/v3/project/<%= project["id"] %>/environment/<%= environment["id"] %>/category' query with JSON body
    """
    <%= @formatter.json(provider + '/category') %>

    """
    Then response should be '422'
    And the Content-Type header should include 'application/json'

<% end %>

