mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Admin] Prevent from adding inconsistent routes to the store
This commit is contained in:
parent
4a5ce5c66c
commit
8cb82262a3
2 changed files with 28 additions and 2 deletions
|
|
@ -8,10 +8,10 @@ Feature: Routes validation
|
|||
Given the store has static content "Krzysztof Krawczyk"
|
||||
And I am logged in as an administrator
|
||||
|
||||
@ui @todo
|
||||
@ui
|
||||
Scenario: Trying to add a new route without specifying its name
|
||||
Given I want to add a new route
|
||||
When I choose "Krzysztof Krawczyk" as its content
|
||||
And I add it
|
||||
Then I should be notified that name is required
|
||||
And the route "krzysztof-krawczyk" should not be added
|
||||
And the route with content "Krzysztof Krawczyk" should not be added
|
||||
|
|
|
|||
|
|
@ -182,4 +182,30 @@ final class ManagingRoutesContext implements Context
|
|||
sprintf('Cannot find route with name "%s" and content "%s" assigned.', $route->getName(), $contentTitle)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that name is required
|
||||
*/
|
||||
public function iShouldBeNotifiedThatElementIsRequired()
|
||||
{
|
||||
Assert::same(
|
||||
$this->createPage->getValidationMessage('name'),
|
||||
'This value should not be blank.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the route with content :title should not be added
|
||||
*/
|
||||
public function theRouteWithContentShouldNotBeAdded($title)
|
||||
{
|
||||
if (!$this->indexPage->isOpen()) {
|
||||
$this->indexPage->open();
|
||||
}
|
||||
|
||||
Assert::false(
|
||||
$this->indexPage->isSingleResourceOnPage(['content' => $title]),
|
||||
sprintf('Found route with content "%s" assigned, but expected not to.', $title)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue