@api @data_kitten
Feature: Rerun autogenerated certificates

  Background:
    Given I am signed in as the API user
    And I want to create a certificate via the API
    And I apply a campaign "brian"
    And the field "publisherUrl" is missing from my metadata
    And my URL autocompletes via DataKitten

  Scenario: Rerun an autogenerated certificate with new data
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "0 certificates published"
    When I add the field "publisherUrl" with the value "http://example.com" to my metadata
    And my URL autocompletes via DataKitten
    And I click "regenerate"
    Then I should see "1 certificate published"

  Scenario: User can be added on regenerate
    Given I request that the API creates a user
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "api@example.com"
    When my metadata has the email "brian@example.com" associated
    And I click "regenerate"
    Then I should see "brian@example.com"

  Scenario: User doesn't get changed on regenerate
    Given my metadata has the email "brian@example.com" associated
    And I request that the API creates a user
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "brian@example.com"
    When I click "regenerate"
    Then I should see "brian@example.com"

@api @data_kitten
Feature: Rerun autogenerated certificates

  Background:
    Given I am signed in as the API user
    And I want to create a certificate via the API
    And I apply a campaign "brian"
    And the field "publisherUrl" is missing from my metadata
    And my URL autocompletes via DataKitten

  Scenario: Rerun an autogenerated certificate with new data
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "0 certificates published"
    When I add the field "publisherUrl" with the value "http://example.com" to my metadata
    And my URL autocompletes via DataKitten
    And I click "Rerun certification"
    Then I should see "1 certificate published"

  Scenario: User can be added on regenerate
    Given I request that the API creates a user
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "api@example.com"
    When my metadata has the email "brian@example.com" associated
    And I click "Rerun certification"
    Then I should see "brian@example.com"

  Scenario: User doesn't get changed on regenerate
    Given my metadata has the email "brian@example.com" associated
    And I request that the API creates a user
    When I request a certificate via the API
    And the certificate is created
    And I visit the campaign page for "brian"
    Then I should see "brian@example.com"
    When I click "Rerun certification"
    Then I should see "brian@example.com"

Use renamed button in features
Use renamed button in features