Skip to content

Commit

Permalink
Merge pull request Sylius#8058 from alcaeus/remove-option-value-count…
Browse files Browse the repository at this point in the history
…-constraint

Remove count constraint on option values collection
  • Loading branch information
lchrusciel committed May 26, 2017
2 parents 2f494d3 + 2338cd1 commit 8b86032
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
Expand Up @@ -18,3 +18,23 @@ Feature: Adding a new product option
And I add it
Then I should be notified that it has been successfully created
And the product option "T-Shirt size" should appear in the registry

@ui
Scenario: Adding a new product option without any option values
Given I want to create a new product option
When I name it "T-Shirt size" in "English (United States)"
And I specify its code as "t_shirt_size"
But I do not add an option value
And I try to add it
Then I should be notified that it has been successfully created
And the product option "T-Shirt size" should appear in the registry

@ui @javascript
Scenario: Adding a new product option with one option value
Given I want to create a new product option
When I name it "T-Shirt size" in "English (United States)"
And I specify its code as "t_shirt_size"
And I add the "S" option value identified by "OV1"
And I try to add it
Then I should be notified that it has been successfully created
And the product option "T-Shirt size" should appear in the registry
Expand Up @@ -38,23 +38,3 @@ Feature: Product option validation
And I try to save my changes
Then I should be notified that name is required
And this product option should still be named "T-Shirt color"

@ui
Scenario: Trying to add a new product option without any option values
Given I want to create a new product option
When I name it "T-Shirt size" in "English (United States)"
And I specify its code as "t_shirt_size"
But I do not add an option value
And I try to add it
Then I should be notified that at least two option values are required
And the product option with name "T-Shirt size" should not be added

@ui @javascript
Scenario: Trying to add a new product option with one option value
Given I want to create a new product option
When I name it "T-Shirt size" in "English (United States)"
And I specify its code as "t_shirt_size"
And I add the "S" option value identified by "OV1"
And I try to add it
Then I should be notified that at least two option values are required
And the product option with name "T-Shirt size" should not be added
Expand Up @@ -31,11 +31,6 @@
</property>
<property name="values">
<constraint name="Valid" />
<constraint name="Count">
<option name="min">2</option>
<option name="minMessage">sylius.option.values.min_count</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="translations">
<constraint name="Valid" />
Expand Down
Expand Up @@ -2,9 +2,6 @@
"code": 400,
"message": "Validation Failed",
"errors": {
"errors": [
"Please add at least 2 option values."
],
"children": {
"position": {},
"translations": {},
Expand Down

0 comments on commit 8b86032

Please sign in to comment.