Review fixes

This commit is contained in:
Arminek 2016-04-26 12:04:49 +02:00
parent 313273c739
commit 17c3313990
12 changed files with 31 additions and 35 deletions

View file

@ -23,9 +23,8 @@
<parameter key="sylius.behat.context.ui.admin.managing_product_options.class">Sylius\Behat\Context\Ui\Admin\ManagingProductOptionsContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_product_options.class">Sylius\Behat\Context\Ui\Admin\ManagingProductOptionsContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_promotions.class">Sylius\Behat\Context\Ui\Admin\ManagingPromotionsContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_promotions.class">Sylius\Behat\Context\Ui\Admin\ManagingPromotionsContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_shipping_methods.class">Sylius\Behat\Context\Ui\Admin\ManagingShippingMethodsContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_shipping_methods.class">Sylius\Behat\Context\Ui\Admin\ManagingShippingMethodsContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_taxons.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxonsContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_tax_category.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxCategoryContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_tax_categories.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxCategoriesContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_tax_categories.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxCategoriesContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_taxons.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxonsContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_tax_rate.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxRateContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_tax_rate.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxRateContext</parameter>
<parameter key="sylius.behat.context.ui.admin.managing_zones.class">Sylius\Behat\Context\Ui\Admin\ManagingZonesContext</parameter> <parameter key="sylius.behat.context.ui.admin.managing_zones.class">Sylius\Behat\Context\Ui\Admin\ManagingZonesContext</parameter>
@ -130,18 +129,18 @@
<tag name="sylius.behat.context" /> <tag name="sylius.behat.context" />
</service> </service>
<service id="sylius.behat.context.ui.admin.managing_taxons" class="%sylius.behat.context.ui.admin.managing_taxons.class%" scope="scenario"> <service id="sylius.behat.context.ui.admin.managing_tax_categories" class="%sylius.behat.context.ui.admin.managing_tax_categories.class%" scope="scenario">
<argument type="service" id="sylius.behat.page.admin.taxon.create" /> <argument type="service" id="sylius.behat.page.admin.tax_category.index" />
<argument type="service" id="sylius.behat.page.admin.taxon.update" /> <argument type="service" id="sylius.behat.page.admin.tax_category.create" />
<argument type="service" id="sylius.behat.page.admin.tax_category.update" />
<argument type="service" id="sylius.behat.current_page_resolver" /> <argument type="service" id="sylius.behat.current_page_resolver" />
<argument type="service" id="sylius.behat.notification_checker" /> <argument type="service" id="sylius.behat.notification_checker" />
<tag name="sylius.behat.context" /> <tag name="sylius.behat.context" />
</service> </service>
<service id="sylius.behat.context.ui.admin.managing_tax_categories" class="%sylius.behat.context.ui.admin.managing_tax_categories.class%" scope="scenario"> <service id="sylius.behat.context.ui.admin.managing_taxons" class="%sylius.behat.context.ui.admin.managing_taxons.class%" scope="scenario">
<argument type="service" id="sylius.behat.page.admin.tax_category.index" /> <argument type="service" id="sylius.behat.page.admin.taxon.create" />
<argument type="service" id="sylius.behat.page.admin.tax_category.create" /> <argument type="service" id="sylius.behat.page.admin.taxon.update" />
<argument type="service" id="sylius.behat.page.admin.tax_category.update" />
<argument type="service" id="sylius.behat.current_page_resolver" /> <argument type="service" id="sylius.behat.current_page_resolver" />
<argument type="service" id="sylius.behat.notification_checker" /> <argument type="service" id="sylius.behat.notification_checker" />
<tag name="sylius.behat.context" /> <tag name="sylius.behat.context" />

View file

@ -5,8 +5,7 @@ Feature: Adding a new taxon
I want to add a new taxon to the registry I want to add a new taxon to the registry
Background: Background:
Given the store operates on a single channel in "France" Given I am logged in as an administrator
And I am logged in as an administrator
@ui @ui
Scenario: Adding a new taxon Scenario: Adding a new taxon
@ -30,7 +29,7 @@ Feature: Adding a new taxon
@ui @ui
Scenario: Adding a new taxon with parent taxon Scenario: Adding a new taxon with parent taxon
Given the store classifies its products as "Category" Given the store has "Category" taxonomy
And I want to create a new taxon And I want to create a new taxon
When I specify its code as "stickers" When I specify its code as "stickers"
And I name it "Stickers" in "English (United States)" And I name it "Stickers" in "English (United States)"

View file

@ -5,8 +5,7 @@ Feature: Browsing taxons
I want to browse taxons I want to browse taxons
Background: Background:
Given the store operates on a single channel in "France" Given the store classifies its products as "T-Shirts" and "Accessories"
And the store classifies its products as "T-Shirts" and "Accessories"
And I am logged in as an administrator And I am logged in as an administrator
@ui @ui

View file

@ -5,12 +5,11 @@ Feature: Deleting a taxon
I want to be able to delete a taxon I want to be able to delete a taxon
Background: Background:
Given the store operates on a single channel in "France" Given I am logged in as an administrator
And the store classifies its products as "T-Shirts"
And I am logged in as an administrator
@ui @ui
Scenario: Deleted taxon should disappear from the registry Scenario: Deleted taxon should disappear from the registry
Given the store classifies its products as "T-Shirts"
When I delete taxon named "T-Shirts" When I delete taxon named "T-Shirts"
Then I should be notified that it has been successfully deleted Then I should be notified that it has been successfully deleted
And the taxon named "T-Shirts" should no longer exist in the registry And the taxon named "T-Shirts" should no longer exist in the registry

View file

@ -5,8 +5,7 @@ Feature: Editing a taxon
I want to be able to edit a taxon I want to be able to edit a taxon
Background: Background:
Given the store operates on a single channel in "France" Given the store classifies its products as "T-Shirts" and "Accessories"
And the store classifies its products as "T-Shirts" and "Accessories"
And I am logged in as an administrator And I am logged in as an administrator
@ui @ui

View file

@ -54,6 +54,7 @@ final class TaxonomyContext implements Context
} }
/** /**
* @Given the store has :firstTaxonName taxonomy
* @Given the store classifies its products as :firstTaxonName * @Given the store classifies its products as :firstTaxonName
* @Given the store classifies its products as :firstTaxonName and :secondTaxonName * @Given the store classifies its products as :firstTaxonName and :secondTaxonName
* @Given the store classifies its products as :firstTaxonName, :secondTaxonName and :thirdTaxonName * @Given the store classifies its products as :firstTaxonName, :secondTaxonName and :thirdTaxonName

View file

@ -207,7 +207,7 @@ final class ManagingTaxonsContext implements Context
/** /**
* @Then I should be notified that it has been successfully edited * @Then I should be notified that it has been successfully edited
*/ */
public function iShouldBeNotifiedAboutSuccessfulEdition() public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
{ {
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME); $this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
} }
@ -228,7 +228,7 @@ final class ManagingTaxonsContext implements Context
$this->updatePage->open(['id' => $taxon->getId()]); $this->updatePage->open(['id' => $taxon->getId()]);
Assert::true( Assert::true(
$this->updatePage->hasResourceValues(['code' => $taxon->getCode()]), $this->updatePage->hasResourceValues(['code' => $taxon->getCode()]),
sprintf('Taxon %s should be in the registry', $taxon->getName()) sprintf('Taxon %s should be in the registry.', $taxon->getName())
); );
} }
@ -239,18 +239,18 @@ final class ManagingTaxonsContext implements Context
{ {
Assert::true( Assert::true(
$this->updatePage->hasResourceValues([$element => $value]), $this->updatePage->hasResourceValues([$element => $value]),
sprintf('Taxon with %s should have %s value', $element, $value) sprintf('Taxon with %s should have %s value.', $element, $value)
); );
} }
/** /**
* @Then the code field should be disabled * @Then the code field should be disabled
*/ */
public function theCodeFiledShouldBeDisabled() public function theCodeFieldShouldBeDisabled()
{ {
Assert::true( Assert::true(
$this->updatePage->isCodeDisabled(), $this->updatePage->isCodeDisabled(),
'Code field should be disabled but it is not' 'Code field should be disabled but it is not.'
); );
} }
@ -261,7 +261,7 @@ final class ManagingTaxonsContext implements Context
{ {
Assert::true( Assert::true(
$this->updatePage->hasResourceValues(['parent' => $taxon->getId()]), $this->updatePage->hasResourceValues(['parent' => $taxon->getId()]),
sprintf('Current taxon should have %s parent taxon', $taxon->getName()) sprintf('Current taxon should have %s parent taxon.', $taxon->getName())
); );
} }
@ -311,21 +311,21 @@ final class ManagingTaxonsContext implements Context
Assert::eq( Assert::eq(
0, 0,
$this->createPage->countTaxonsByName($name), $this->createPage->countTaxonsByName($name),
sprintf('Taxon %s should not exist', $name) sprintf('Taxon %s should not exist.', $name)
); );
} }
/** /**
* @Then /^I should see (\d+) taxons on the list$/ * @Then /^I should see (\d+) taxons on the list$/
*/ */
public function iShouldSeeZonesInTheList($number) public function iShouldSeeTaxonsInTheList($number)
{ {
$taxonsOnPage = $this->createPage->countTaxons(); $taxonsOnPage = $this->createPage->countTaxons();
Assert::eq( Assert::eq(
$number, $number,
$taxonsOnPage, $taxonsOnPage,
sprintf('On list should be %d taxons but get %d', $number, $taxonsOnPage) sprintf('On list should be %d taxons but get %d.', $number, $taxonsOnPage)
); );
} }
@ -337,7 +337,7 @@ final class ManagingTaxonsContext implements Context
Assert::eq( Assert::eq(
1, 1,
$this->createPage->countTaxonsByName($name), $this->createPage->countTaxonsByName($name),
sprintf('Taxon %s does not exist', $name) sprintf('Taxon %s does not exist or multiple taxons with this name exist.', $name)
); );
} }
} }

View file

@ -70,6 +70,8 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
break; break;
} }
} }
throw new ElementNotFoundException($this->getDriver(), 'Delete button');
} }
/** /**

View file

@ -20,7 +20,6 @@ sylius_admin_taxon_index:
_controller: sylius.controller.taxon:indexAction _controller: sylius.controller.taxon:indexAction
_sylius: _sylius:
template: SyliusAdminBundle:Taxon:index.html.twig template: SyliusAdminBundle:Taxon:index.html.twig
section: admin
repository: repository:
method: findRootNodes method: findRootNodes
host: "localhost" host: "localhost"
@ -33,6 +32,9 @@ sylius_admin_taxon_create:
_sylius: _sylius:
template: SyliusAdminBundle:Taxon:create.html.twig template: SyliusAdminBundle:Taxon:create.html.twig
section: admin section: admin
redirect:
route: sylius_admin_taxon_update
parameters: { id: resource.id }
vars: vars:
templates: templates:
form: SyliusAdminBundle:Taxon:_form.html.twig form: SyliusAdminBundle:Taxon:_form.html.twig

View file

@ -13,9 +13,6 @@
<div class="header">{{ taxon.name }}</div> <div class="header">{{ taxon.name }}</div>
{{ buttons.delete(path('sylius_admin_taxon_delete', { 'id': taxon.id }), 'sylius.ui.delete'|trans) }} {{ buttons.delete(path('sylius_admin_taxon_delete', { 'id': taxon.id }), 'sylius.ui.delete'|trans) }}
{{ buttons.edit(path('sylius_admin_taxon_update', { 'id': taxon.id })) }} {{ buttons.edit(path('sylius_admin_taxon_update', { 'id': taxon.id })) }}
{% if not taxon.description %}
<div class="description">{{ taxon.description }}</div>
{% endif %}
<div class="list"> <div class="list">
{{ _self.renderLeaf(taxon.children) }} {{ _self.renderLeaf(taxon.children) }}
</div> </div>

View file

@ -9,4 +9,4 @@
{{ parent() }} {{ parent() }}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -59,7 +59,6 @@ sylius:
manage_product_option: Manage product option manage_product_option: Manage product option
manage_shipping_destinations: Manage shipping destinations manage_shipping_destinations: Manage shipping destinations
manage_taxons: Manage taxons of your products manage_taxons: Manage taxons of your products
manage_taxation_of_your_products: Manage taxation of your products
manage_shipping_methods_for_your_store: Manage shipping methods for your store manage_shipping_methods_for_your_store: Manage shipping methods for your store
manage_taxation_of_your_products: Manage taxation of your products manage_taxation_of_your_products: Manage taxation of your products
new: New new: New