categories_block.feature
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Feature: categories_block
As an admin
I want to manage the categories block
Background:
Given I am on the homepage
And the following product_categories
| name | display_in_menu |
| Food | true |
| Book | true |
And the following product_categories
| parent | name | display_in_menu |
| Food | Vegetarian | true |
| Food | Steak | true |
| Book | Fiction | false |
| Book | Literature | true |
And the following categories
| name | display_in_menu |
| Wood | true |
And the following regions
| name | display_in_menu |
| Bahia | true |
And the following blocks
| owner | type |
| environment | CategoriesBlock |
And I am logged in as admin
@selenium
Scenario: List just product categories
Given I go to /admin/environment_design
And I follow "Edit" within ".categories-block"
And I check "Product"
When I press "Save"
Then I should see "Food"
And I should see "Book"
And I should not see "Vegetarian"
And I should not see "Steak"
And I should not see "Fiction"
@selenium
Scenario: Show submenu if it exists
Given I go to /admin/environment_design
And I follow "Edit" within ".categories-block"
And I check "Product"
And I press "Save"
Then I should see "Food"
And I should see "Book"
And I should not see "Vegetarian"
And I should not see "Steak"
And I should not see "Literature"
When I click ".category-link-expand category-root"
Then I should see "Literature"
When I click ".category-link-expand category-root"
Then I should see "Vegetarian"
And I should see "Steak"
And I should not see "Fiction"
@selenium
Scenario: Show only one submenu per time
Given I go to /admin/environment_design
And I follow "Edit" within ".categories-block"
And I check "Product"
And I press "Save"
Then I should see "Book"
And I should not see "Literature"
When I click ".category-link-expand category-root"
Then I should see "Literature"
@selenium
Scenario: List just general categories
Given I go to /admin/environment_design
And I follow "Edit" within ".categories-block"
And I check "Generic Category"
When I press "Save"
Then I should see "Wood"
@selenium
Scenario: List just regions
Given I go to /admin/environment_design
And I follow "Edit" within ".categories-block"
And I check "Region"
When I press "Save"
Then I should see "Bahia"