mardi 21 avril 2015

Pass through a mandatory parameters in my Behat scenario

I am trying to determine how to pass through a mandatory parameter required to follow a defined route within my Behat features file.

This is my scenario:

Scenario: I should be able to create a press asset
    Given I am on the ayrshireminis_cars_asset_create page
    When I submit a "ayrshireminis.cars.asset.type" form with values:
        | name               | type | position | active |
        | Cars Info Doc      | PDF  | 1        | 1      |
    Then The form should be valid

and this is the error:

Given I am on the ayrshireminis_cars_asset_create page Some mandatory parameters are missing ("categoryId") to generate a URL for route "ayrshireminis_cars_asset_create". (Symfony\Component\Routing\Exception\MissingMandatoryParametersException)

It's clear why I get this error as my routing is configured like this:

ayrshireminis_cars_asset_create:
    pattern: /category/{categoryId}/asset/new/

How can I pass through a categoryId?

Aucun commentaire:

Enregistrer un commentaire