@provider
Feature: Create provider account

  <% @formatter.get_fixture('providers/all').each do |provider| %>
  <% provider_fake_account = @formatter.get_fixture("#{provider}/fake_account") %>
  <% generate_create_path_scenarios "Create #{provider} account", "/v3/provider/#{provider}/account", provider_fake_account, @formatter.get_fixture("#{provider}/fake_account_mandatory_fields"), provider %>
  <% generate_delete_path_scenarios "Delete #{provider} account", "/v3/provider/#{provider}/account/#{provider_fake_account["account_name"]}", provider %>
  <% end %>
  <% @formatter.get_fixture('providers/without_static').each do |provider| %>
  <% provider_account = @formatter.get_fixture("#{provider}/account") %>

  <% [ "security_groups" ].each do |action| %>
  <% generate_get_path_scenarios_with_provider "Get #{action}", "/v3/provider/#{provider}/account/#{provider_account['account_name']}/#{action}", provider do %>
  And the JSON response should be an object
  <% end %>

  @<%= provider %>
  Scenario: Get <%= action %> of unknown account
    When I send GET '/v3/provider/<%= provider %>/account/unknown/<%= action %>' query
    Then response should be '404'
    And the Content-Type header should include 'application/json'
    And the JSON response should be an object


  <% end %>

  <% [ "flavors", "networks", "images" ].each do |action| %>
  <% generate_get_path_scenarios_with_provider "Get #{action}", "/v3/provider/#{provider}/account/#{provider_account['account_name']}/#{action}", provider do %>
  And the JSON response should be an array
  <% end %>

  @<%= provider %>
  Scenario: Get <%= action %> of unknown account
    When I send GET '/v3/provider/<%= provider %>/account/unknown/<%= action %>' query
    Then response should be '404'
    And the Content-Type header should include 'application/json'
    And the JSON response should be an object

  <% end %>

  <% end %>

  <% provider_account = @formatter.get_fixture("aws/account") %>
  @aws
  <% generate_get_path_scenarios "Get vpcs for aws", "/v3/provider/aws/account/#{provider_account['account_name']}/vpcs" do %>
  And the JSON response should be an array
  <% end %>
