Fix taxons deletion

This commit is contained in:
Kamil Kokot 2017-06-30 12:26:32 +02:00
parent 58b40ef74f
commit 050d494dd3
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
2 changed files with 5 additions and 3 deletions

View file

@ -16,8 +16,10 @@ Feature: Deleting a taxon
@ui @ui
Scenario: Deleting a taxon with a child does not delete any other taxons Scenario: Deleting a taxon with a child does not delete any other taxons
Given the store classifies its products as "Main catalog" Given the store classifies its products as "Main catalog"
Given the "Main catalog" taxon has children taxon "Shoes" and "Shovels" And the "Main catalog" taxon has children taxon "Shoes" and "Shovels"
And the "Shoes" taxon has children taxon "Men" and "Women" And the "Shoes" taxon has children taxon "Men" and "Women"
When I delete taxon named "Shoes" When I delete taxon named "Shoes"
Then the taxon named "Shoes" should no longer exist in the registry Then the taxon named "Shoes" should no longer exist in the registry
And the "Shovels" taxon should appear in the registry And the taxon named "Men" should no longer exist in the registry
And the taxon named "Women" should no longer exist in the registry
But the "Shovels" taxon should appear in the registry

View file

@ -34,7 +34,7 @@
<one-to-many field="children" target-entity="Sylius\Component\Taxonomy\Model\TaxonInterface" mapped-by="parent"> <one-to-many field="children" target-entity="Sylius\Component\Taxonomy\Model\TaxonInterface" mapped-by="parent">
<cascade> <cascade>
<cascade-all /> <cascade-persist />
</cascade> </cascade>
<order-by> <order-by>
<order-by-field name="position" direction="ASC" /> <order-by-field name="position" direction="ASC" />