2015-04-21 21 views
1

我正在嘗試確定如何通過必需的參數來遵循我的Behat功能文件中定義的路徑。在我的Behat場景中通過必需的參數

這是我的情景:

Scenario: I should be able to create a cars 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 

,這是錯誤:

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)

很清楚,爲什麼我得到這個錯誤我的路由配置是這樣的:

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

如何通過categoryId

回答

0

我發現,我是從錯誤的角度看這個,這是我構建的測試場景中結束了:

Scenario: Submitting a valid cars asset form 
    When I submit a "ayrshireminis.cars.cars_asset.type" form with values: 
     | name    | type | position | active | 
     | Cars Info Doc  | pdf | 1  | 1  | 
    Then the form should be valid 
    And the cars entity form entity should have the following values 
     | name    | type | position | active | 
     | Cars Info Doc  | pdf | 1  | 1  | 
    And the cars entity form entity should be persisted correctly 
相關問題