search_enterprises.feature
4.46 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Feature: search enterprises
As a noosfero user
I want to search enterprises
In order to find ones that interest me
Background:
Given the search index is empty
And the following enterprises
| identifier | name |
| shop1 | Shoes shop |
| shop2 | Fruits shop |
And the following categories as facets
| name |
| Temáticas |
Scenario: show recent enterprises on index (empty query)
When I go to the search enterprises page
Then I should see "Shoes shop" within "#search-results"
And I should see "Fruits shop" within "#search-results"
Scenario: simple search for enterprise
When I go to the search enterprises page
And I fill in "query" with "shoes"
And I press "Search"
Then I should see "Shoes shop"
And I should not see "Fruits shop"
Scenario: see default facets when searching
When I go to the search enterprises page
And I fill in "query" with "shoes"
And I press "Search"
Then I should see "City" within "#facets-menu"
Scenario: see category facets when searching
When I go to the search enterprises page
And I fill in "query" with "shoes"
And I press "Search"
Then I should see "Temáticas" within "#facets-menu"
Scenario: see region on facets and results
Given the following cities
| name | state |
| Pres. Prudente | SP |
And the following enterprises
| identifier | name | city |
| art-pp | Artesanato PP | Pres. Prudente |
When I go to the search enterprises page
And I fill in "query" with "Artesanato"
And I press "Search"
Then I should see "Pres. Prudente" within "#facet-menu-f_region"
And I should see ", SP" within "#facet-menu-f_region"
And I should see "Pres. Prudente, SP" within "#search-results"
Scenario: find enterprise by region
Given the following cities
| name | state |
| Pres. Prudente | SP |
And the following enterprises
| identifier | name | city |
| art-pp | Artesanato PP | Pres. Prudente |
When I go to the search enterprises page
And I fill in "query" with "Prudente"
And I press "Search"
Then I should see "Artesanato PP" within "#search-results"
Scenario: find enterprise by category
Given the following categories
| name |
| Software Livre |
And the following enterprises
| identifier | name | category |
| noosfero | Noosfero | software-livre |
When I go to the search enterprises page
And I fill in "query" with "software"
And I press "Search"
Then I should see "Noosfero" within "#search-results"
Scenario: find enterprises without exact query
Given the following enterprises
| identifier | name |
| noosfero | Noosfero Developers Association |
When I go to the search enterprises page
And I fill in "query" with "Noosfero Association"
And I press "Search"
Then I should see "Noosfero Developers Association" within "#search-results"
Scenario: filter enterprises by facet
Given the following category
| name | parent |
| Software Livre | tematicas |
And the following enterprises
| identifier | name | category |
| noosfero | Noosfero Developers | software-livre |
| facebook | Facebook Developers | |
When I go to the search enterprises page
And I fill in "query" with "Developers"
And I press "Search"
And I follow "Software Livre" within "#facets-menu"
Then I should see "Noosfero Developers" within "#search-results"
And I should not see "Facebook Developers"
Scenario: remember facet filter when searching new query
Given the following category
| name | parent |
| Software Livre | tematicas |
And the following enterprises
| identifier | name | category |
| noosfero | Noosfero Developers | software-livre |
| rails-dev | Rails Developers | |
| rails-usr | Rails Users | software-livre |
When I go to the search enterprises page
And I fill in "query" with "Developers"
And I press "Search"
And I follow "Software Livre" within "#facets-menu"
And I fill in "query" with "Rails"
And I press "Search"
Then I should see "Rails Users" within "#search-results"
And I should not see "Rails Developers"