Commit af28c09451c4e5c2994a9d3da9a2c9ebaf4a49e9

Authored by Weblate
2 parents d1bb0ea5 2f8c7665

Merge remote-tracking branch 'origin/master'

app/controllers/public/profile_controller.rb
@@ -17,8 +17,11 @@ class ProfileController < PublicController @@ -17,8 +17,11 @@ class ProfileController < PublicController
17 end 17 end
18 @tags = profile.article_tags 18 @tags = profile.article_tags
19 unless profile.display_info_to?(user) 19 unless profile.display_info_to?(user)
20 - profile.visible? ? private_profile : invisible_profile  
21 - render :action => 'index', :status => 403 20 + if profile.visible?
  21 + private_profile
  22 + else
  23 + invisible_profile
  24 + end
22 end 25 end
23 end 26 end
24 27
@@ -395,6 +398,7 @@ class ProfileController < PublicController @@ -395,6 +398,7 @@ class ProfileController < PublicController
395 398
396 def private_profile 399 def private_profile
397 private_profile_partial_parameters 400 private_profile_partial_parameters
  401 + render :action => 'index', :status => 403
398 end 402 end
399 403
400 def invisible_profile 404 def invisible_profile
app/controllers/public/search_controller.rb
@@ -90,10 +90,14 @@ class SearchController < PublicController @@ -90,10 +90,14 @@ class SearchController < PublicController
90 end 90 end
91 91
92 def events 92 def events
93 - year = (params[:year] ? params[:year].to_i : Date.today.year)  
94 - month = (params[:month] ? params[:month].to_i : Date.today.month)  
95 - day = (params[:day] ? params[:day].to_i : Date.today.day)  
96 - @date = build_date(year, month, day) 93 + if params[:year].blank? && params[:year].blank? && params[:day].blank?
  94 + @date = Date.today
  95 + else
  96 + year = (params[:year] ? params[:year].to_i : Date.today.year)
  97 + month = (params[:month] ? params[:month].to_i : Date.today.month)
  98 + day = (params[:day] ? params[:day].to_i : 1)
  99 + @date = build_date(year, month, day)
  100 + end
97 date_range = (@date - 1.month).at_beginning_of_month..(@date + 1.month).at_end_of_month 101 date_range = (@date - 1.month).at_beginning_of_month..(@date + 1.month).at_end_of_month
98 102
99 @events = [] 103 @events = []
config/initializers/i18n.rb
1 # necessary for I18n.default_locale to work 1 # necessary for I18n.default_locale to work
2 require 'i18n/backend/fallbacks' 2 require 'i18n/backend/fallbacks'
3 I18n.backend.class.send :include, I18n::Backend::Fallbacks 3 I18n.backend.class.send :include, I18n::Backend::Fallbacks
4 - 4 +I18n.enforce_available_locales = false
features/change_organization_name.feature
@@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
1 -Feature: change organization name  
2 - As an organization's admin  
3 - I want to change it's name  
4 - In order to keep it's name consistent  
5 -  
6 - Scenario: changing community's name  
7 - Given the following communities  
8 - | identifier | name |  
9 - | sample-community | Sample Community |  
10 - And the following users  
11 - | login | name |  
12 - | joaosilva | Joao Silva |  
13 - And "Joao Silva" is admin of "Sample Community"  
14 - And I am logged in as "joaosilva"  
15 - And I am on sample-community's control panel  
16 - And I follow "Community Info and settings"  
17 - And I fill in "Name" with "New Sample Community"  
18 - When I press "Save"  
19 - Then I should be on sample-community's control panel  
20 - And I should see "New Sample Community" within "title"  
21 -  
22 - Scenario: changing enterprise's name  
23 - Given the following enterprises  
24 - | identifier | name |  
25 - | sample-enterprise | Sample Enterprise |  
26 - And the following users  
27 - | login | name |  
28 - | joaosilva | Joao Silva |  
29 - And "Joao Silva" is admin of "Sample Enterprise"  
30 - And I am logged in as "joaosilva"  
31 - And I am on sample-enterprise's control panel  
32 - And I follow "Enterprise Info and settings"  
33 - And I fill in "Name" with "New Sample Enterprise"  
34 - When I press "Save"  
35 - Then I should be on sample-enterprise's control panel  
36 - And I should see "New Sample Enterprise" within "title"  
features/chat.feature
@@ -1,145 +0,0 @@ @@ -1,145 +0,0 @@
1 -Feature: chat  
2 - As a Noosfero user  
3 - I want to chat with my friends  
4 -  
5 - Background:  
6 - Given the following users  
7 - | login | name |  
8 - | tame | Tame |  
9 - | mariasilva | Maria Silva |  
10 - | josesilva | Jose Silva |  
11 - And "tame" is online in chat  
12 - And "mariasilva" is online in chat  
13 - And "josesilva" is online in chat  
14 - And "tame" is friend of "mariasilva"  
15 - And "tame" is friend of "josesilva"  
16 -  
17 - @selenium  
18 - Scenario: provide link to open chat  
19 - Given feature "xmpp_chat" is enabled on environment  
20 - And I am logged in as "tame"  
21 - Then I should see "Open chat" within "#user"  
22 -  
23 - @selenium  
24 - Scenario: provide the chat online users content  
25 - Given feature "xmpp_chat" is enabled on environment  
26 - And I am logged in as "tame"  
27 - Then I should see "Friends in chat "  
28 -  
29 - @selenium  
30 - Scenario: provide the chat online users list  
31 - Given the profile "tame" has no blocks  
32 - And feature "xmpp_chat" is enabled on environment  
33 - And I am logged in as "tame"  
34 - And I go to tame's profile  
35 - When I follow "chat-online-users-title"  
36 - Then I should see "Maria Silva"  
37 - And I should see "Jose Silva"  
38 -  
39 - Scenario: not provide link to chat when environment not support that  
40 - Given I am logged in as "tame"  
41 - Then I should not see "Open chat" within "#user"  
42 -  
43 - Scenario: not provide link to chat when the user is logged out  
44 - Given I am on tame's homepage  
45 - Then I should not see "Open chat" within "#user"  
46 -  
47 - @selenium  
48 - Scenario: not provide the chat online users list when environment not support that  
49 - Given I am logged in as "tame"  
50 - Then I should not see "Friends in chat "  
51 -  
52 - Scenario: block access to chat when environment not support that  
53 - Given I am logged in as "tame"  
54 - When I go to chat  
55 - Then I should see "There is no such page"  
56 -  
57 - Scenario: block access to chat for guest users  
58 - Given feature "xmpp_chat" is enabled on environment  
59 - When I go to chat  
60 - Then I should be on login page  
61 -  
62 - @selenium  
63 - Scenario: open chat in a new window  
64 - Given feature "xmpp_chat" is enabled on environment  
65 - And I am logged in as "tame"  
66 - When I follow "Open chat"  
67 - And I select window "noosfero_chat"  
68 - Then I should see "Chat - Colivre.net - Friends online (0)"  
69 -  
70 - @selenium  
71 - Scenario: open chat with an online user in a new window  
72 - Given the profile "tame" has no blocks  
73 - And feature "xmpp_chat" is enabled on environment  
74 - And I am logged in as "tame"  
75 - And I go to tame's profile  
76 - When I follow "chat-online-users-title"  
77 - And I follow "Maria Silva"  
78 - And I select window "noosfero_chat"  
79 - Then I should see "Chat - Colivre.net - Friends online (0)"  
80 -  
81 - @selenium  
82 - Scenario: chat starts disconnected by default  
83 - Given feature "xmpp_chat" is enabled on environment  
84 - And I am logged in as "tame"  
85 - When I follow "Open chat"  
86 - And I select window "noosfero_chat"  
87 - Then I should see "Offline" within "a"  
88 -  
89 - @selenium  
90 - Scenario: view options to change my chat status through menu  
91 - Given feature "xmpp_chat" is enabled on environment  
92 - And I am logged in as "tame"  
93 - And I follow "Open chat"  
94 - When I select window "noosfero_chat"  
95 - Then "Online" should not be visible within "#user-status"  
96 - And "Busy" should not be visible within "#user-status"  
97 - And "Sign out of chat" should not be visible within "#user-status"  
98 - When I follow "Offline"  
99 - Then "Online" should be visible within "#user-status"  
100 - And "Busy" should be visible within "#user-status"  
101 - And "Sign out of chat" should be visible within "#user-status"  
102 -  
103 - @selenium  
104 - Scenario: link to open chatroom of a community  
105 - Given the following communities  
106 - | identifier | name |  
107 - | autoramas | Autoramas |  
108 - And "Tame" is a member of "Autoramas"  
109 - And feature "xmpp_chat" is enabled on environment  
110 - And I am logged in as "tame"  
111 - When I go to autoramas's profile  
112 - Then I should see "Enter chat room"  
113 -  
114 - @selenium  
115 - Scenario: not see link to open chatroom of a community if not a member  
116 - Given the following communities  
117 - | identifier | name |  
118 - | autoramas | Autoramas |  
119 - And feature "xmpp_chat" is enabled on environment  
120 - And I am logged in as "tame"  
121 - When I go to autoramas's profile  
122 - Then I should not see "Enter chat room" within "a"  
123 -  
124 - @selenium  
125 - Scenario: not see link to open chatroom of a community if xmpp_chat disabled  
126 - Given the following communities  
127 - | identifier | name |  
128 - | autoramas | Autoramas |  
129 - And "Tame" is a member of "Autoramas"  
130 - And I am logged in as "tame"  
131 - When I go to autoramas's profile  
132 - Then I should not see "Enter chat room" within "a"  
133 -  
134 - @selenium  
135 - Scenario: open chatroom of a community in a new window  
136 - Given feature "xmpp_chat" is enabled on environment  
137 - And the following communities  
138 - | identifier | name |  
139 - | autoramas | Autoramas |  
140 - And "Tame" is a member of "Autoramas"  
141 - And I am logged in as "tame"  
142 - When I go to autoramas's profile  
143 - And I follow "Enter chat room"  
144 - And I select window "noosfero_chat"  
145 - Then I should see "Chat - Colivre.net - Friends online (0)"  
features/edit_profile.feature
@@ -27,44 +27,3 @@ Feature: edit profile @@ -27,44 +27,3 @@ Feature: edit profile
27 And I press "Save" 27 And I press "Save"
28 Then I should not see "Birth date is invalid" 28 Then I should not see "Birth date is invalid"
29 And I should not see "Birth date is mandatory" 29 And I should not see "Birth date is mandatory"
30 -  
31 - @selenium  
32 - Scenario: Alert about url change  
33 - Given the following community  
34 - | identifier | name | owner |  
35 - | o-rappa | O Rappa | joao |  
36 - And feature "enable_organization_url_change" is enabled on environment  
37 - And I go to o-rappa's control panel  
38 - When I follow "Community Info and settings"  
39 - Then I should not see "WARNING" within "#identifier-change-confirmation"  
40 - And I fill in "Address" with "banda-o-rappa"  
41 - When I leave the "#profile_data_identifier" field  
42 - Then I should see "WARNING" within "#identifier-change-confirmation"  
43 -  
44 - @selenium  
45 - Scenario: Confirm url change  
46 - Given the following community  
47 - | identifier | name | owner |  
48 - | o-rappa | O Rappa | joao |  
49 - And feature "enable_organization_url_change" is enabled on environment  
50 - And I go to o-rappa's control panel  
51 - And I follow "Community Info and settings"  
52 - And I fill in "Address" with "banda-o-rappa"  
53 - When I leave the "#profile_data_identifier" field  
54 - Then I should see "WARNING" within "#identifier-change-confirmation"  
55 - When I follow "Yes"  
56 - Then I should not see "WARNING" within "#identifier-change-confirmation"  
57 -  
58 - @selenium  
59 - Scenario: Cancel url change  
60 - Given the following community  
61 - | identifier | name | owner |  
62 - | o-rappa | O Rappa | joao |  
63 - And feature "enable_organization_url_change" is enabled on environment  
64 - And I go to o-rappa's control panel  
65 - And I follow "Community Info and settings"  
66 - And I fill in "Address" with "banda-o-rappa"  
67 - When I leave the "#profile_data_identifier" field  
68 - Then I should see "WARNING" within "#identifier-change-confirmation"  
69 - When I follow "No"  
70 - Then I should not see "WARNING" within "#identifier-change-confirmation"  
features/highlights_block.feature
@@ -1,44 +0,0 @@ @@ -1,44 +0,0 @@
1 -Feature: Edit Highlight Block  
2 - As a user  
3 - I want to edit the highlight block  
4 -  
5 - Background:  
6 - Given I am on the homepage  
7 - And the following users  
8 - | login | name |  
9 - | jose | Jose Silva |  
10 - And I am logged in as "jose"  
11 -  
12 - @selenium  
13 - Scenario: Add new highlight  
14 - Given I follow "Control panel"  
15 - And I follow "Edit sideboxes"  
16 - And I follow "Add a block"  
17 - And I choose "Highlights"  
18 - And I press "Add"  
19 - And I follow "Edit" within ".highlights-block"#Need to hover the mouse on the box  
20 - And I follow "New highlight"  
21 - And I fill in "block_images__address" with "/"  
22 - And I fill in "block_images__position" with "0"  
23 - And I fill in "block_images__title" with "test highlights"  
24 - And I press "Save"  
25 - And I follow "Edit" within ".highlights-block"  
26 - Then I should see "Title"  
27 -  
28 - @selenium-fixme  
29 - Scenario: Remove one saved highlight  
30 - Given I follow "Control panel"  
31 - And I follow "Edit sideboxes"  
32 - And I follow "Add a block"  
33 - And I choose "Highlights"  
34 - And I press "Add"  
35 - And I follow "Edit" within ".highlights-block"  
36 - And I follow "New highlight"  
37 - And I fill in "block_images__address" with "/"  
38 - And I fill in "block_images__position" with "0"  
39 - And I fill in "block_images__title" with "test highlights"#Need to hover the mouse on the box  
40 - And I press "Save"  
41 - And I follow "Edit" within ".highlights-block"  
42 - And I follow "" within ".delete-highlight"  
43 - And I confirm the browser dialog  
44 - Then I should not see "Title"  
45 \ No newline at end of file 0 \ No newline at end of file
features/manage_inputs.feature
@@ -1,247 +0,0 @@ @@ -1,247 +0,0 @@
1 -Feature: manage inputs  
2 - As an enterprise owner  
3 - I want to manage my product's inputs  
4 -  
5 - Background:  
6 - Given the following users  
7 - | login | name |  
8 - | joaosilva | Joao Silva |  
9 - And the following enterprises  
10 - | identifier | owner | name | enabled |  
11 - | redemoinho | joaosilva | Rede Moinho | true |  
12 - Given the following product_category  
13 - | name |  
14 - | Music |  
15 - And the following product_categories  
16 - | name | parent |  
17 - | Rock | music |  
18 - | CD Player | music |  
19 - And the following product  
20 - | owner | category | name |  
21 - | redemoinho | rock | Abbey Road |  
22 - And feature "products_for_enterprises" is enabled on environment  
23 - And the following units  
24 - | singular | plural |  
25 - | Meter | Meters |  
26 - | Litre | Litres |  
27 -  
28 - @selenium  
29 - Scenario: add first input to a product  
30 - Given I am logged in as "joaosilva"  
31 - When I go to Rede Moinho's page of product Abbey Road  
32 - And I follow "Inputs"  
33 - Then I should not see "Add new input or raw material"  
34 - And I follow "Add the inputs or raw material used by this product"  
35 - And I select "Music »" from "category_id" within "#categories_container_level0"  
36 - And I select "Rock" from "category_id" within "#categories_container_level1"  
37 - And I press "Save and continue"  
38 - Then I should see "Rock"  
39 -  
40 - @selenium  
41 - Scenario: add input to a product that already has inputs  
42 - Given the following input  
43 - | product | category |  
44 - | Abbey Road | music |  
45 - And I am logged in as "joaosilva"  
46 - When I go to Rede Moinho's page of product Abbey Road  
47 - And I follow "Inputs"  
48 - And I should not see "Add the inputs or raw material used by this product"  
49 - And I follow "Add new input or raw material"  
50 - And I select "Music »" from "category_id" within "#categories_container_level0"  
51 - And I select "Rock" from "category_id" within "#categories_container_level1"  
52 - And I press "Save and continue"  
53 - Then I should see "Rock"  
54 -  
55 - @selenium  
56 - Scenario: cancel addition of a product input  
57 - Given I am logged in as "joaosilva"  
58 - When I go to Rede Moinho's page of product Abbey Road  
59 - And I follow "Inputs"  
60 - And I follow "Add the inputs or raw material used by this product"  
61 - And I should see "Cancel" within "#categories_selection_actionbar"  
62 - And I follow "Cancel" within "#categories_selection_actionbar"  
63 - Then I should see "Abbey Road"  
64 - And I should see "Add the inputs or raw material used by this product"  
65 -  
66 - Scenario: show input name and link to add details  
67 - Given the following input  
68 - | product | category |  
69 - | Abbey Road | music |  
70 - And I am logged in as "joaosilva"  
71 - When I go to Rede Moinho's page of product Abbey Road  
72 - And I follow "Inputs and raw material"  
73 - Then I should see "Music" within ".input-name"  
74 - And I should see "Click here to add price and the amount used"  
75 -  
76 - Scenario: Not show input edit button when dont have details yet  
77 - Given the following input  
78 - | product | category |  
79 - | Abbey Road | music |  
80 - And I am logged in as "joaosilva"  
81 - When I go to Rede Moinho's page of product Abbey Road  
82 - And I follow "Inputs and raw material"  
83 - Then I should not see "Edit" within ".input-item"  
84 -  
85 - Scenario: Show button to edit input  
86 - Given the following input  
87 - | product | category | price_per_unit |  
88 - | Abbey Road | music | 10.0 |  
89 - And I am logged in as "joaosilva"  
90 - When I go to Rede Moinho's page of product Abbey Road  
91 - And I follow "Inputs and raw material"  
92 - Then I should see "Edit" within ".input-item"  
93 -  
94 - @selenium-fixme  
95 - Scenario: Order inputs by position  
96 - Given the following product_categories  
97 - | name |  
98 - | Instrumental |  
99 - And the following inputs  
100 - | product | category | position |  
101 - | Abbey Road | Instrumental | 2 |  
102 - | Abbey Road | Rock | 1 |  
103 - | Abbey Road | CD Player | 3 |  
104 - And I am logged in as "joaosilva"  
105 - When I go to Rede Moinho's page of product Abbey Road  
106 - And I follow "Inputs"  
107 - Then I should see "Rock" above of "Instrumental"  
108 - And I should see "Instrumental" above of "CD Player"  
109 -  
110 - @selenium  
111 - Scenario: Save price of input  
112 - Given the following input  
113 - | product | category |  
114 - | Abbey Road | music |  
115 - And I am logged in as "joaosilva"  
116 - When I go to Rede Moinho's page of product Abbey Road  
117 - And I follow "Inputs"  
118 - Then I should see "Music"  
119 - When I follow "Click here to add price and the amount used"  
120 - And I should see "Price"  
121 - And I fill in "Price" with "10.50"  
122 - And I press "Save"  
123 - Then I should not see "Save"  
124 -  
125 - @selenium  
126 - Scenario: Update label of input price with selected unit  
127 - Given the following input  
128 - | product | category |  
129 - | Abbey Road | music |  
130 - And I am logged in as "joaosilva"  
131 - When I go to Rede Moinho's page of product Abbey Road  
132 - And I follow "Inputs"  
133 - And I follow "Click here to add price and the amount used"  
134 - And I should not see "Price by Meter ($)"  
135 - When I select "Meter" from "input_unit_id" within ".edit_input"  
136 - Then I should see "Price by Meter ($)"  
137 -  
138 - @selenium  
139 - Scenario: Save all price details of input  
140 - Given the following input  
141 - | product | category |  
142 - | Abbey Road | music |  
143 - And I am logged in as "joaosilva"  
144 - When I go to Rede Moinho's page of product Abbey Road  
145 - And I follow "Inputs"  
146 - And I follow "Click here to add price and the amount used"  
147 - And I fill in "Amount used" with "2.5"  
148 - And I fill in "Price" with "11.50"  
149 - And I select "Meter" from "input_unit_id" within ".edit_input"  
150 - And I press "Save"  
151 - Then I should see "2.5"  
152 - And I should see "Meter"  
153 - And I should not see "$ 11.50"  
154 -  
155 - @selenium  
156 - Scenario: Save and then edit price details of input  
157 - Given the following input  
158 - | product | category |  
159 - | Abbey Road | music |  
160 - And I am logged in as "joaosilva"  
161 - When I go to Rede Moinho's page of product Abbey Road  
162 - And I follow "Inputs"  
163 - And I follow "Click here to add price and the amount used"  
164 - And I fill in "Amount used" with "2.5"  
165 - And I fill in "Price" with "11.50"  
166 - And I select "Meter" from "input_unit_id" within ".edit_input"  
167 - And I press "Save"  
168 - Then I should see "2.5"  
169 - And I should see "Meter"  
170 - When I follow "Edit" within ".input-details"  
171 - And I fill in "Amount used" with "3.0"  
172 - And I fill in "Price" with "23.31"  
173 - And I select "Litre" from "input_unit_id" within ".edit_input"  
174 - And I press "Save"  
175 - Then I should see "3"  
176 - And I should see "Litre"  
177 -  
178 - @selenium  
179 - Scenario: Cancel edition of a input  
180 - Given the following input  
181 - | product | category |  
182 - | Abbey Road | music |  
183 - And I am logged in as "joaosilva"  
184 - When I go to Rede Moinho's page of product Abbey Road  
185 - And I follow "Inputs"  
186 - And I follow "Click here to add price and the amount used"  
187 - Then I should see "Cancel"  
188 - And I should see "Amount used"  
189 - And I should see "Price"  
190 - And I should see "This input or raw material inpact on the final price of the product?"  
191 - When I follow "Cancel" within ".edit_input"  
192 - Then I should see "Click here to add price and the amount used"  
193 -  
194 - @selenium  
195 - Scenario: Cancel edition of an input then edit again  
196 - Given the following input  
197 - | product | category | price_per_unit | unit |  
198 - | Abbey Road | music | 10.0 | Meter |  
199 - And I am logged in as "joaosilva"  
200 - When I go to Rede Moinho's page of product Abbey Road  
201 - And I follow "Inputs"  
202 - And I follow "Edit" within ".input-details"  
203 - And I should see "Cancel" within ".edit_input"  
204 - And I follow "Cancel" within ".edit_input"  
205 - And I follow "Edit" within ".input-details"  
206 - Then I should see "Amount used"  
207 - And I should see "Price by Meter"  
208 -  
209 - @selenium  
210 - Scenario: remove input  
211 - Given the following input  
212 - | product | category |  
213 - | Abbey Road | rock |  
214 - And I am logged in as "joaosilva"  
215 - And I go to Rede Moinho's page of product Abbey Road  
216 - And I follow "Inputs"  
217 - Then I should see "Rock"  
218 - And I should not see "Add the inputs or raw material used by this product"  
219 - When I follow "Remove"  
220 - And I confirm the browser dialog  
221 - Then I should see "Add the inputs or raw material used by this product"  
222 -  
223 - @selenium-fixme  
224 - Scenario: Order input list  
225 - Given the following product_category  
226 - | name |  
227 - | Movie |  
228 - And the following product  
229 - | owner | category | name |  
230 - | redemoinho | Movie | Ramones |  
231 - And the following inputs  
232 - | product | category |  
233 - | Ramones | Rock |  
234 - | Ramones | Music |  
235 - | Ramones | CD Player |  
236 - And I am logged in as "joaosilva"  
237 - When I go to Rede Moinho's page of product Ramones  
238 - And I follow "Inputs"  
239 - Then I should see "Rock" above of "Music"  
240 - And I should see "Music" above of "CD Player"  
241 - When I drag "Rock" to "Music"  
242 - Then I should see "Music" above of "Rock"  
243 - And I should see "Rock" above of "CD Player"  
244 - When I follow "Back to the product listing"  
245 - And I go to Rede Moinho's page of product Ramones  
246 - Then I should see "Music" above of "Rock"  
247 - And I should see "Rock" above of "CD Player"  
features/manage_product_price_details.feature
@@ -1,179 +0,0 @@ @@ -1,179 +0,0 @@
1 -Feature: manage product price details  
2 - As an enterprise owner  
3 - I want to manage the details of product's price  
4 -  
5 - Background:  
6 - Given the following users  
7 - | login | name |  
8 - | joaosilva | Joao Silva |  
9 - And the following enterprises  
10 - | identifier | owner | name | enabled |  
11 - | redemoinho | joaosilva | Rede Moinho | true |  
12 - Given the following product_category  
13 - | name |  
14 - | Music |  
15 - And the following product_categories  
16 - | name | parent |  
17 - | Rock | music |  
18 - | CD Player | music |  
19 - And the following product  
20 - | owner | category | name | price |  
21 - | redemoinho | rock | Abbey Road | 80.0 |  
22 - And feature "products_for_enterprises" is enabled on environment  
23 - And the following inputs  
24 - | product | category | price_per_unit | amount_used |  
25 - | Abbey Road | Rock | 10.0 | 2 |  
26 - | Abbey Road | CD Player | 20.0 | 2 |  
27 - And the following production cost  
28 - | name | owner |  
29 - | Taxes | environment |  
30 - And I am logged in as "joaosilva"  
31 -  
32 - @selenium  
33 - Scenario: list total value of inputs as price details  
34 - Given I go to Rede Moinho's page of product Abbey Road  
35 - And I follow "Price composition"  
36 - And I follow "Describe here the cost of production"  
37 - Then I should see "Inputs"  
38 - And I should see "60.0" within ".inputs-cost"  
39 -  
40 - @selenium  
41 - Scenario: return to product after save  
42 - Given I go to Rede Moinho's page of product Abbey Road  
43 - And I follow "Price composition"  
44 - And I follow "Describe here the cost of production"  
45 - And I press "Save"  
46 - Then I should be on Rede Moinho's page of product Abbey Road  
47 -  
48 - @selenium  
49 - Scenario: add first item on price details  
50 - Given I go to Rede Moinho's page of product Abbey Road  
51 - And I follow "Price composition"  
52 - And I follow "Describe here the cost of production"  
53 - And I follow "New cost"  
54 - And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"  
55 - And I fill in "$" with "5.00"  
56 - And I leave the "#price_details__price" field  
57 - And I press "Save"  
58 - Then I should not see "Save"  
59 - And I should see "Describe here the cost of production"  
60 -  
61 - @selenium  
62 - Scenario: edit a production cost  
63 - Given the following production cost  
64 - | name | owner |  
65 - | Energy | environment |  
66 - When I go to Rede Moinho's page of product Abbey Road  
67 - And I follow "Price composition"  
68 - And I follow "Describe here the cost of production"  
69 - And I follow "New cost"  
70 - And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"  
71 - And I fill in "$" with "20.00"  
72 - And I leave the ".price-details-price" field  
73 - And I press "Save"  
74 - Then I should not see "Save"  
75 - And I should see "Taxes" within "#display-price-details"  
76 - When I follow "Describe here the cost of production"  
77 - And I select "Energy" from "price_details__production_cost_id" within "#display-product-price-details"  
78 - And I leave the "#price_details__price" field  
79 - And I press "Save"  
80 - And I should not see "Taxes" within "#display-price-details"  
81 - And I should see "Energy" within "#display-price-details"  
82 -  
83 - Scenario: not display price composition if product does not have input  
84 - Given the following product  
85 - | owner | category | name |  
86 - | redemoinho | rock | Yellow Submarine |  
87 - And the following user  
88 - | login | name |  
89 - | mariasouza | Maria Souza |  
90 - And I am logged in as "mariasouza"  
91 - When I go to Rede Moinho's page of product Yellow Submarine  
92 - Then I should not see "Price composition"  
93 -  
94 - Scenario: not display price composition if price is not fully described  
95 - Given I am not logged in  
96 - And I go to Rede Moinho's page of product Abbey Road  
97 - Then I should not see "Price composition"  
98 -  
99 - @selenium  
100 - Scenario: display price details if price is fully described  
101 - Given I go to Rede Moinho's page of product Abbey Road  
102 - And I follow "Price composition"  
103 - And I follow "Describe here the cost of production"  
104 - And I follow "New cost"  
105 - And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details"  
106 - And I fill in "$" with "20.00"  
107 - And I press "Save"  
108 - And I go to Rede Moinho's page of product Abbey Road  
109 - Then I should see "Inputs" within ".price-detail-name"  
110 - And I should see "60.0" within ".price-detail-price"  
111 -  
112 - @selenium  
113 - Scenario: create a new cost clicking on select  
114 - Given I go to Rede Moinho's page of product Abbey Road  
115 - And I follow "Price composition"  
116 - And I follow "Describe here the cost of production"  
117 - And I follow "New cost"  
118 - And I select "Other cost" from "price_details__production_cost_id" within "#display-product-price-details"  
119 - And I want to add "Energy" as cost  
120 - And I fill in "$" with "10.00"  
121 - And I leave the "#price_details__price" field  
122 - And I press "Save"  
123 - When I follow "Describe here the cost of production"  
124 - Then I should see "Energy" within ".production-cost-selection"  
125 -  
126 - @selenium  
127 - Scenario: add created cost on new-cost-fields  
128 - Given I go to Rede Moinho's page of product Abbey Road  
129 - And I follow "Price composition"  
130 - And I follow "Describe here the cost of production"  
131 - And I follow "New cost"  
132 - And I select "Other cost" from "price_details__production_cost_id" within "#display-product-price-details"  
133 - And I want to add "Energy" as cost  
134 - Then I should see "Energy" within "#display-product-price-details"  
135 -  
136 - @selenium  
137 - Scenario: remove price detail  
138 - Given the following price detail  
139 - | product | production_cost | price |  
140 - | Abbey Road | Taxes | 20.0 |  
141 - And I go to Rede Moinho's page of product Abbey Road  
142 - And I follow "Price composition"  
143 - And I follow "Describe here the cost of production"  
144 - And I should see "Taxes" within "#manage-product-details-form"  
145 - When I follow "Remove" within "#manage-product-details-form"  
146 - And I confirm the browser dialog  
147 - And I press "Save"  
148 - And I follow "Describe here the cost of production"  
149 - Then I should not see "Taxes" within "#manage-product-details-form"  
150 -  
151 - Scenario: display progressbar  
152 - Given I go to Rede Moinho's page of product Abbey Road  
153 - And I follow "Price composition"  
154 - And I follow "Describe here the cost of production"  
155 - Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text"  
156 -  
157 - @selenium  
158 - Scenario: update value on progressbar after addition of new cost  
159 - Given I go to Rede Moinho's page of product Abbey Road  
160 - And I follow "Price composition"  
161 - And I follow "Describe here the cost of production"  
162 - Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text"  
163 - And I follow "New cost"  
164 - And I fill in "$" with "10.00"  
165 - And I leave the "#price_details__price" field  
166 - Then I should see "$ 70.00 of $ 80.00" within "#progressbar-text"  
167 -  
168 - @selenium  
169 - Scenario: update value on progressbar after editing an input  
170 - Given I go to Rede Moinho's page of product Abbey Road  
171 - And I follow "Price composition"  
172 - And I follow "Describe here the cost of production"  
173 - Then I should see "$ 60.00 of $ 80.00" within "#progressbar-text"  
174 - When I follow "Inputs"  
175 - And I follow "Edit" within ".input-details"  
176 - And I fill in "Price" with "23.31"  
177 - And I press "Save"  
178 - Then I follow "Price composition"  
179 - And I should see "$ 86.62 of $ 80.00" within "#progressbar-text"  
features/manage_products.feature
@@ -1,520 +0,0 @@ @@ -1,520 +0,0 @@
1 -Feature: manage products  
2 - As an enterprise owner  
3 - I want to manage my products  
4 -  
5 - Background:  
6 - Given the following users  
7 - | login | name |  
8 - | joaosilva | Joao Silva |  
9 - And the following enterprises  
10 - | identifier | owner | name | enabled |  
11 - | redemoinho | joaosilva | Rede Moinho | true |  
12 - And feature "products_for_enterprises" is enabled on environment  
13 -  
14 - Scenario: display "create new product" button  
15 - Given I am logged in as "joaosilva"  
16 - And I am on redemoinho's control panel  
17 - When I follow "Manage Products/Services"  
18 - Then I should see "New product or service"  
19 -  
20 - Scenario: paginate public listing products and services  
21 - Given the following product_category  
22 - | name |  
23 - | Bicycle |  
24 - And the following products  
25 - | owner | category | name | description | created_at |  
26 - | redemoinho | bicycle | Bike A | bicycle 1 | 2014-04-01 01:00:00 |  
27 - | redemoinho | bicycle | Bike B | bicycle 2 | 2014-04-01 02:00:00 |  
28 - | redemoinho | bicycle | Bike C | bicycle 3 | 2014-04-01 03:00:00 |  
29 - | redemoinho | bicycle | Bike D | bicycle 4 | 2014-04-01 04:00:00 |  
30 - | redemoinho | bicycle | Bike E | bicycle 5 | 2014-04-01 05:00:00 |  
31 - | redemoinho | bicycle | Bike F | bicycle 6 | 2014-04-01 06:00:00 |  
32 - | redemoinho | bicycle | Bike G | bicycle 7 | 2014-04-01 07:00:00 |  
33 - | redemoinho | bicycle | Bike H | bicycle 8 | 2014-04-01 08:00:00 |  
34 - | redemoinho | bicycle | Bike I | bicycle 9 | 2014-04-01 09:00:00 |  
35 - | redemoinho | bicycle | Bike J | bicycle 10 | 2014-04-01 10:00:00 |  
36 - | redemoinho | bicycle | Bike K | bicycle 11 | 2014-04-01 11:00:00 |  
37 - When I go to redemoinho's products page  
38 - Then I should see "Bike A" within "#product-list"  
39 - And I should see "Bike B" within "#product-list"  
40 - And I should see "Bike C" within "#product-list"  
41 - And I should see "Bike D" within "#product-list"  
42 - And I should see "Bike E" within "#product-list"  
43 - And I should see "Bike F" within "#product-list"  
44 - And I should not see "Bike G" within "#product-list"  
45 - And I should not see "Bike H" within "#product-list"  
46 - And I should not see "Bike I" within "#product-list"  
47 - And I should not see "Bike J" within "#product-list"  
48 - And I should not see "Bike K" within "#product-list"  
49 - When I follow "Next"  
50 - Then I should see "Bike G" within "#product-list"  
51 - Then I should see "Bike H" within "#product-list"  
52 - Then I should see "Bike I" within "#product-list"  
53 - Then I should see "Bike J" within "#product-list"  
54 - Then I should see "Bike K" within "#product-list"  
55 -  
56 - Scenario: listing products and services  
57 - Given I am logged in as "joaosilva"  
58 - And I am on redemoinho's control panel  
59 - And I follow "Manage Products/Services"  
60 - Then I should see "Listing products and services"  
61 -  
62 - Scenario: see button to back in categories hierarchy  
63 - Given I am logged in as "joaosilva"  
64 - And I am on redemoinho's control panel  
65 - And I follow "Manage Products/Services"  
66 - When I follow "New product or service"  
67 - Then I should see "Back to the product listing" link  
68 -  
69 - Scenario: see toplevel categories  
70 - Given the following product_categories  
71 - | name |  
72 - | Products |  
73 - | Services |  
74 - Given I am logged in as "joaosilva"  
75 - And I go to redemoinho's new product page  
76 - Then I should see "Products"  
77 - And I should see "Service"  
78 -  
79 - @selenium  
80 - Scenario: select a toplevel category and see subcategories  
81 - Given the following product_categories  
82 - | name |  
83 - | Products level0 |  
84 - And the following product_categories  
85 - | name | parent |  
86 - | Computers level1 | products-level0 |  
87 - | DVDs level1 | products-level0 |  
88 - Given I am logged in as "joaosilva"  
89 - And I go to redemoinho's new product page  
90 - And I select "Products level0 »" from "category_id" within "#categories_container_level0"  
91 - Then I should see "Computers level1"  
92 - And I should see "DVDs level1"  
93 -  
94 - @selenium  
95 - Scenario: hide subcategories when select other toplevel category  
96 - Given the following product_categories  
97 - | name |  
98 - | Products level0 |  
99 - | Services level0 |  
100 - And the following product_categories  
101 - | name | parent |  
102 - | Computers level1 | products-level0 |  
103 - | Software development level1 | services-level0 |  
104 - Given I am logged in as "joaosilva"  
105 - And I go to redemoinho's new product page  
106 - And I should not see /Computers level/  
107 - And I select "Products level0 »" from "category_id" within "#categories_container_wrapper"  
108 - And I should see /Computers level/  
109 - And I should not see /Software develop/  
110 - And I select "Services level0 »" from "category_id" within "#categories_container_wrapper"  
111 - Then I should see /Software develop/  
112 - And I should not see /Computers level/  
113 -  
114 - @selenium  
115 - Scenario: show hierarchy of categories  
116 - Given the following product_categories  
117 - | name |  
118 - | Products |  
119 - And the following product_category  
120 - | name | parent |  
121 - | Computers | products |  
122 - Given I am logged in as "joaosilva"  
123 - And I go to redemoinho's new product page  
124 - And I select "Products »" from "category_id" within "#categories_container_level0"  
125 - And I select "Computers" from "category_id" within "#categories_container_level1"  
126 - Then I should see "Products → Computers"  
127 -  
128 - @selenium  
129 - Scenario: show links in hierarchy of categories and not link current category  
130 - Given the following product_category  
131 - | name |  
132 - | Toplevel Product Categories |  
133 - Given the following product_category  
134 - | name | parent |  
135 - | Category Level 1 | toplevel-product-categories |  
136 - Given I am logged in as "joaosilva"  
137 - And I go to redemoinho's new product page  
138 - And I select "Toplevel Product Categories »" from "category_id" within "#categories_container_level0"  
139 - And I select "Category Level 1" from "category_id" within "#categories_container_level1"  
140 - Then I should see "Toplevel Product Categories" link  
141 - And I should not see "Category Level 1" link  
142 -  
143 - @selenium  
144 - Scenario: save button come initialy disabled  
145 - Given the following product_category  
146 - | name |  
147 - | Only for test |  
148 - And I am logged in as "joaosilva"  
149 - When I go to redemoinho's new product page  
150 - Then the "#save_and_continue" button should be disabled  
151 -  
152 - @selenium  
153 - Scenario: enable save button when select one category  
154 - Given I am logged in as "joaosilva"  
155 - And the following product_category  
156 - | name |  
157 - | Browsers (accept categories) |  
158 - When I go to redemoinho's new product page  
159 - And I select "Browsers (accept categories)" from "category_id" within "#categories_container_wrapper"  
160 - Then the "#save_and_continue" button should be enabled  
161 -  
162 - @selenium  
163 - Scenario: dont enable save button when select category with not accept products  
164 - Given the following product_category  
165 - | name | accept_products |  
166 - | Browsers | false |  
167 - Given I am logged in as "joaosilva"  
168 - When I go to redemoinho's new product page  
169 - And I select "Browsers" from "category_id" within "#categories_container_wrapper"  
170 - Then the "#save_and_continue" button should be disabled  
171 -  
172 - @selenium  
173 - Scenario: save product  
174 - Given the following product_category  
175 - | name |  
176 - | Bicycle |  
177 - Given I am logged in as "joaosilva"  
178 - When I go to redemoinho's new product page  
179 - And I select "Bicycle" from "category_id" within "#categories_container_wrapper"  
180 - And I press "Save and continue"  
181 - When I go to redemoinho's products page  
182 - And I follow "Bicycle" within "#product-list"  
183 - Then I should see "Bicycle" within "#show_product"  
184 - And I should see "Change category"  
185 -  
186 - Scenario: a user with permission can see edit links  
187 - Given the following product_category  
188 - | name |  
189 - | Bicycle |  
190 - And the following products  
191 - | owner | category | name | description |  
192 - | redemoinho | bicycle | Bike | Red bicycle |  
193 - And I am logged in as "joaosilva"  
194 - When I go to Rede Moinho's page of product Bike  
195 - Then I should see "Change category"  
196 - And I should see "Edit name"  
197 - And I should see "Edit description"  
198 - And I should see "Change image"  
199 -  
200 - Scenario: an allowed user will see a different button when has no description  
201 - Given the following product_category  
202 - | name |  
203 - | Bicycle |  
204 - And the following products  
205 - | owner | category | name |  
206 - | redemoinho | bicycle | Bike |  
207 - And I am logged in as "joaosilva"  
208 - When I go to Rede Moinho's page of product Bike  
209 - Then I should see "Change category"  
210 - And I should see "Edit name"  
211 - And I should see "Add some description to your product"  
212 - And I should see "Add price and other basic information"  
213 - And I should see "Change image"  
214 -  
215 - Scenario: an allowed user will see a different button when has no basic info  
216 - Given the following product_category  
217 - | name |  
218 - | Bicycle |  
219 - And the following products  
220 - | owner | category | name |  
221 - | redemoinho | bicycle | Bike |  
222 - And I am logged in as "joaosilva"  
223 - When I go to Rede Moinho's page of product Bike  
224 - Then I should see "Change category"  
225 - And I should see "Edit name"  
226 - And I should see "Add price and other basic information"  
227 - And I should see "Change image"  
228 -  
229 - Scenario: a not logged user cannot see edit links  
230 - Given I am not logged in  
231 - And the following product_category  
232 - | name |  
233 - | Bicycle |  
234 - And the following products  
235 - | owner | category | name | description |  
236 - | redemoinho | bicycle | Bike | Red bicycle |  
237 - When I go to Rede Moinho's page of product Bike  
238 - Then I should not see "Change category"  
239 - And I should not see "Edit name"  
240 - And I should not see "Edit description"  
241 - And I should not see "Edit basic information"  
242 - And I should not see "Change image"  
243 -  
244 - Scenario: a not allowed user cannot see edit links  
245 - Given the following users  
246 - | login | name |  
247 - | mariasantos | Maria Santos |  
248 - And the following product_category  
249 - | name |  
250 - | Bicycle |  
251 - And the following products  
252 - | owner | category | name | description |  
253 - | redemoinho | bicycle | Bike | Red bicycle |  
254 - And I am logged in as "mariasantos"  
255 - When I go to Rede Moinho's page of product Bike  
256 - Then I should not see "Change category"  
257 - And I should not see "Edit name"  
258 - And I should not see "Edit description"  
259 - And I should not see "Edit basic information"  
260 - And I should not see "Change image"  
261 -  
262 - @selenium  
263 - Scenario: edit name of a product  
264 - Given the following product_category  
265 - | name |  
266 - | Bicycle |  
267 - And the following products  
268 - | owner | category | name |  
269 - | redemoinho | bicycle | Bike |  
270 - And I am logged in as "joaosilva"  
271 - When I go to Rede Moinho's page of product Bike  
272 - And I follow "Edit name"  
273 - And I fill in "Red bicycle" for "product_name"  
274 - And I press "Save"  
275 - Then I should see "Red bicycle"  
276 - And I should be on Rede Moinho's page of product Red bicycle  
277 -  
278 - @selenium  
279 - Scenario: cancel edition of a product name  
280 - Given the following product_category  
281 - | name |  
282 - | Bicycle |  
283 - And the following products  
284 - | owner | category | name |  
285 - | redemoinho | bicycle | Bike |  
286 - And I am logged in as "joaosilva"  
287 - When I go to Rede Moinho's page of product Bike  
288 - And I follow "Edit name"  
289 - When I follow "Cancel"  
290 - Then I should see "Bike"  
291 -  
292 - @selenium  
293 - Scenario: edit category of a product  
294 - Given the following product_category  
295 - | name |  
296 - | Eletronics |  
297 - And the following product_categories  
298 - | name | parent |  
299 - | Computers | eletronics |  
300 - | DVDs | eletronics |  
301 - And the following products  
302 - | owner | category | name |  
303 - | redemoinho | computers | Generic pc |  
304 - And I am logged in as "joaosilva"  
305 - When I go to Rede Moinho's page of product Generic pc  
306 - And I follow "Change category"  
307 - And I select "Eletronics »" from "category_id" within "#categories_container_level0"  
308 - Then I select "DVDs" from "category_id" within "#categories_container_level1"  
309 - And I press "Save and continue"  
310 - When I go to Rede Moinho's page of product Generic pc  
311 - Then I should see "Eletronics → DVDs" within ".hierarchy-category"  
312 -  
313 - @selenium  
314 - Scenario: cancel edition of a product category  
315 - Given the following product_category  
316 - | name |  
317 - | Eletronics |  
318 - And the following product_categories  
319 - | name | parent |  
320 - | Computers | eletronics |  
321 - | DVDs | eletronics |  
322 - And the following products  
323 - | owner | category | name |  
324 - | redemoinho | computers | Generic pc |  
325 - And I am logged in as "joaosilva"  
326 - When I go to Rede Moinho's page of product Generic pc  
327 - And I follow "Change category"  
328 - When I follow "Back to product"  
329 - Then I should see "Eletronics → Computers"  
330 -  
331 -  
332 - @selenium  
333 - Scenario: edit image of a product  
334 - Given the following product_category  
335 - | name |  
336 - | Eletronics |  
337 - And the following product_categories  
338 - | name | parent |  
339 - | Computers | eletronics |  
340 - | DVDs | eletronics |  
341 - And the following products  
342 - | owner | category | name |  
343 - | redemoinho | computers | Generic pc |  
344 - And I am logged in as "joaosilva"  
345 - When I go to Rede Moinho's page of product Generic pc  
346 - And I follow "Change image"  
347 - When I follow "Cancel"  
348 - Then I should be on Rede Moinho's page of product Generic pc  
349 -  
350 - # FIXME Not working because of tinyMCE plus selenium  
351 - # @selenium  
352 - # Scenario: edit description of a product  
353 - # Given the following product_category  
354 - # | name |  
355 - # | Bicycle |  
356 - # And the following products  
357 - # | owner | category | name | description |  
358 - # | redemoinho | bicycle | Bike | A new red bicycle |  
359 - # And I am logged in as "joaosilva"  
360 - # When I go to Rede Moinho's page of product Bike  
361 - # Then I should see "A new red bicycle"  
362 - # And I follow "Edit basic information"  
363 - # And I type in tinyMCE field "Description" the text "An used red bicycle"  
364 - # And I press "Save"  
365 - # Then I should not see "A new red bicycle"  
366 - # And I should see "An used red bicycle"  
367 - # And I should be on Rede Moinho's page of product Bike  
368 -  
369 - @selenium  
370 - Scenario: cancel edition of a product description  
371 - Given the following product_category  
372 - | name |  
373 - | Bicycle |  
374 - And the following products  
375 - | owner | category | name | description |  
376 - | redemoinho | bicycle | Bike | A new red bicycle |  
377 - And I am logged in as "joaosilva"  
378 - When I go to Rede Moinho's page of product Bike  
379 - Then I should see "A new red bicycle"  
380 - And I follow "Edit description"  
381 - When I follow "Cancel"  
382 - Then I should see "A new red bicycle"  
383 - And I should be on Rede Moinho's page of product Bike  
384 -  
385 - @selenium  
386 - Scenario: Edit product category and save without select any category  
387 - Given the following product_category  
388 - | name |  
389 - | Eletronics |  
390 - And the following product_category  
391 - | name | parent |  
392 - | Computers | eletronics |  
393 - And the following products  
394 - | owner | category | name |  
395 - | redemoinho | computers | Generic pc |  
396 - And I am logged in as "joaosilva"  
397 - When I go to Rede Moinho's page of product Generic pc  
398 - And I follow "Change category"  
399 - And I press "Save and continue"  
400 - Then I should not see "Product category can't be blank"  
401 - When I go to Rede Moinho's page of product Generic pc  
402 - Then I should see "Eletronics → Computers" within ".hierarchy-category"  
403 -  
404 - And I should see "Generic pc"  
405 -  
406 - @selenium  
407 - Scenario: Scroll categories selection to right when editing  
408 - Given the following product_category  
409 - | name |  
410 - | Eletronics |  
411 - And the following product_category  
412 - | name | parent |  
413 - | Quantum Computers | eletronics |  
414 - And the following product_category  
415 - | name | parent |  
416 - | Laptops from Mars | Quantum Computers |  
417 - And the following product_category  
418 - | name | parent |  
419 - | Netbook from Venus | Laptops from Mars |  
420 - And the following product_category  
421 - | name | parent |  
422 - | Nanonote nanotech with long name | Netbook from Venus |  
423 - And the following products  
424 - | owner | category | name |  
425 - | redemoinho | Nanonote nanotech with long name | Generic pc |  
426 - And I am logged in as "joaosilva"  
427 - When I go to Rede Moinho's page of product Generic pc  
428 - And I follow "Change category"  
429 - Then "Netbook from Venus" should be visible within "#categories_container_wrapper"  
430 -  
431 - @selenium  
432 - Scenario: Truncate long category name in selection of category  
433 - Given the following product_category  
434 - | name |  
435 - | Super Quantum Computers with teraflops |  
436 - | Nanonote nanotech with long long name |  
437 - And the following product_category  
438 - | name | parent |  
439 - | Netbook Quantum | Super Quantum Computers with teraflops |  
440 - And I am logged in as "joaosilva"  
441 - When I go to redemoinho's new product page  
442 - Then I should see "Nanonote nanotech with long lo..."  
443 - And I should see "Super Quantum Computers with t... »"  
444 -  
445 - @selenium  
446 - Scenario: Edit unit of a product together your name  
447 - Given the following product_category  
448 - | name |  
449 - | Bicycle |  
450 - And the following products  
451 - | owner | category | name |  
452 - | redemoinho | bicycle | Bike |  
453 - And the following units  
454 - | singular | plural |  
455 - | Kilo | Kilos |  
456 - And I am logged in as "joaosilva"  
457 - When I go to Rede Moinho's page of product Bike  
458 - And I follow "Edit name and unit"  
459 - And I fill in "Red bicycle" for "product_name"  
460 - And I select "Kilo" from "product_unit_id" within "#product-name-form"  
461 - And I press "Save"  
462 - Then I should see "Red bicycle - kilo"  
463 -  
464 - @selenium  
465 - Scenario: Show info about unavailable product  
466 - Given the following product_category  
467 - | name |  
468 - | Bicycle |  
469 - And the following products  
470 - | owner | category | name |  
471 - | redemoinho | bicycle | Bike |  
472 - And I am logged in as "joaosilva"  
473 - When I go to Rede Moinho's page of product Bike  
474 - And I follow "Add price and other basic information"  
475 - And I fill in "10" for "product_price"  
476 - And I choose "No"  
477 - And I press "Save"  
478 - Then I should see "Product not available!"  
479 -  
480 - @selenium  
481 - Scenario: Add and remove some qualifiers  
482 - Given the following product_category  
483 - | name |  
484 - | Bicycle |  
485 - And the following products  
486 - | owner | category | name |  
487 - | redemoinho | bicycle | Bike |  
488 - And the following qualifiers  
489 - | name |  
490 - | Organic |  
491 - And the following certifiers  
492 - | name | qualifiers |  
493 - | Colivre | Organic |  
494 - And I am logged in as "joaosilva"  
495 - When I go to Rede Moinho's page of product Bike  
496 - And I follow "Add price and other basic information"  
497 - And I follow "Add new qualifier"  
498 - And I select "Organic" from "selected_qualifier" within "#product-qualifiers-list"  
499 - And I press "Save"  
500 - And I go to Rede Moinho's page of product Bike  
501 - Then I should see "Organic (Self declared)"  
502 - When I follow "Edit basic information"  
503 - And I follow "Delete qualifier"  
504 - And I press "Save"  
505 - And I go to Rede Moinho's page of product Bike  
506 - Then I should not see "Organic (Self declared)"  
507 -  
508 - @selenium  
509 - Scenario: Show checkbox to mark product as highlight  
510 - Given the following product_category  
511 - | name |  
512 - | Bicycle |  
513 - And the following products  
514 - | owner | category | name |  
515 - | redemoinho | bicycle | Bike |  
516 - And I am logged in as "joaosilva"  
517 - When I go to Rede Moinho's page of product Bike  
518 - And I follow "Add price and other basic information"  
519 - Then I should see "Highlight this product?"  
520 - And I check "Highlight this product?"  
features/my_network_block.feature
@@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
1 -Feature: my_network_block  
2 - As a blog owner  
3 - I want to see a summary of my network  
4 -  
5 - Background:  
6 - Given the following users  
7 - | login | name |  
8 - | joaosilva | Joao Silva |  
9 - And the following blocks  
10 - | owner | type |  
11 - | joaosilva | MyNetworkBlock |  
12 - | joaosilva | FriendsBlock |  
13 - And the following communities  
14 - | identifier | name | public_profile |  
15 - | public-community | Public Community | true |  
16 - And plugin FriendsBlock is enabled on environment  
17 -  
18 - @selenium  
19 - Scenario: display how many public/private communities I am member  
20 - Given I am logged in as "joaosilva"  
21 - And the following communities  
22 - | identifier | name | owner | public_profile |  
23 - | other-public-community | Other Public Community | joaosilva | true |  
24 - | private-community | Private Community | joaosilva | false |  
25 - And I am on joaosilva's homepage  
26 - And I should see "2 communities"  
27 - When I go to public-community's homepage  
28 - And I follow "Join"  
29 - And I go to joaosilva's homepage  
30 - Then I should see "3 communities"  
31 -  
32 - @selenium  
33 - Scenario: not display how many invisible communities I am member  
34 - Given I am logged in as "joaosilva"  
35 - And the following communities  
36 - | identifier | name | owner | visible |  
37 - | visible-community | Visible Community | joaosilva | true |  
38 - | not-visible-community | Not Visible Community | joaosilva | false |  
39 - And I am on joaosilva's homepage  
40 - And I should see "One community"  
41 - When I go to public-community's homepage  
42 - And I follow "Join"  
43 - And I go to joaosilva's homepage  
44 - Then I should see "2 communities"  
45 -  
46 - Scenario: display how many public/private friends I have  
47 - Given the following users  
48 - | login | name | public_profile |  
49 - | mariasilva | Maria Silva | true |  
50 - | josesilva | Jose Silva | false |  
51 - And the following blocks  
52 - | owner | type |  
53 - | mariasilva | FriendsBlock |  
54 - | josesilva | FriendsBlock |  
55 - And "joaosilva" is friend of "mariasilva"  
56 - And I am logged in as "joaosilva"  
57 - And I am on joaosilva's homepage  
58 - Then I should see "1 friend"  
59 - And "joaosilva" is friend of "josesilva"  
60 - When I go to joaosilva's homepage  
61 - Then I should see "2 friends"  
62 -  
63 - Scenario: not display how many invisible friends I have  
64 - Given the following users  
65 - | login | name |  
66 - | mariasilva | Maria Silva |  
67 - | josesilva | Jose Silva |  
68 - And the following blocks  
69 - | owner | type |  
70 - | mariasilva | FriendsBlock |  
71 - | josesilva | FriendsBlock |  
72 - And "josesilva" is invisible  
73 - And "joaosilva" is friend of "mariasilva"  
74 - And I am logged in as "joaosilva"  
75 - When I go to joaosilva's homepage  
76 - Then I should see "1 friend"  
77 - And "joaosilva" is friend of "josesilva"  
78 - When I go to joaosilva's homepage  
79 - Then I should see "1 friend"  
features/session_and_cookies_handling.feature
@@ -1,40 +0,0 @@ @@ -1,40 +0,0 @@
1 -Feature: session and cookies handling  
2 -  
3 - As a Noosfero system administrator  
4 - I want Noosfero to manage well it usage of sessions and cookies  
5 - So that we can use HTTP caching effectively  
6 -  
7 - @fixme  
8 - Scenario: home page, logged in  
9 - Given the following users  
10 - | login |  
11 - | joaosilva |  
12 - When I am logged in as "joaosilva"  
13 - And I go to the homepage  
14 - Then there must be a cookie "_noosfero_session"  
15 -  
16 - Scenario: home page, not logged in  
17 - When I go to the homepage  
18 - Then there must be no cookies  
19 -  
20 - @fixme  
21 - Scenario: user_data, not logged in  
22 - When I make a AJAX request to the user data path  
23 - Then there must be no cookies  
24 -  
25 - @fixme  
26 - Scenario: user_data, logged in  
27 - Given I am logged in as admin  
28 - When I make a AJAX request to the user data path  
29 - Then there must be a cookie "_noosfero_session"  
30 -  
31 - # FIXME for some reason I could not test this scenario, although manual tests  
32 - # indicate this works!  
33 - # Scenario: logout  
34 - # Given the following users  
35 - # | login |  
36 - # | joao |  
37 - # When I am logged in as "joao"  
38 - # And I log off  
39 - # And I go to the homepage  
40 - # Then there must be no cookies  
features/signup.feature
@@ -297,7 +297,8 @@ Feature: signup @@ -297,7 +297,8 @@ Feature: signup
297 | Full name | José da Silva | 297 | Full name | José da Silva |
298 And wait for the captcha signup time 298 And wait for the captcha signup time
299 And I press "Create my account" 299 And I press "Create my account"
300 - Then "José da Silva" should be a member of "Free Software" 300 + Then I should see "Control panel"
  301 + And "José da Silva" should be a member of "Free Software"
301 302
302 @selenium 303 @selenium
303 Scenario: user registration is moderated by admin 304 Scenario: user registration is moderated by admin
@@ -349,4 +350,4 @@ Feature: signup @@ -349,4 +350,4 @@ Feature: signup
349 And I fill in "Username / Email" with "teste" 350 And I fill in "Username / Email" with "teste"
350 And I fill in "Password" with "123456" 351 And I fill in "Password" with "123456"
351 And I press "Log in" 352 And I press "Log in"
352 - Then I should not see "teste"  
353 \ No newline at end of file 353 \ No newline at end of file
  354 + Then I should not see "teste"
features/step_definitions/noosfero_steps.rb
@@ -692,11 +692,6 @@ Given /^the cache is turned (on|off)$/ do |state| @@ -692,11 +692,6 @@ Given /^the cache is turned (on|off)$/ do |state|
692 ActionController::Base.perform_caching = (state == 'on') 692 ActionController::Base.perform_caching = (state == 'on')
693 end 693 end
694 694
695 -When /^I make a AJAX request to (.*)$/ do |page|  
696 - header 'X-Requested-With', 'XMLHttpRequest'  
697 - visit(path_to(page))  
698 -end  
699 -  
700 Given /^the environment is configured to (.*) after login$/ do |option| 695 Given /^the environment is configured to (.*) after login$/ do |option|
701 redirection = case option 696 redirection = case option
702 when 'stay on the same page' 697 when 'stay on the same page'
lib/tasks/ci.rake
@@ -24,7 +24,7 @@ namespace :ci do @@ -24,7 +24,7 @@ namespace :ci do
24 end 24 end
25 end 25 end
26 26
27 - sh 'testrb', *tests unless tests.empty? 27 + sh 'testrb', '-Itest', *tests unless tests.empty?
28 sh 'cucumber', *features unless features.empty? 28 sh 'cucumber', *features unless features.empty?
29 sh 'cucumber', '-p', 'selenium', *features unless features.empty? 29 sh 'cucumber', '-p', 'selenium', *features unless features.empty?
30 end 30 end
plugins/ldap/install.rb
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -begin  
2 - gem "net-ldap", '=0.3.1'  
3 -rescue Gem::LoadError => exception  
4 - system "gem install --user-install net-ldap -v 0.3.1"  
5 -end  
6 -  
7 -puts "WARNING: This plugin is not setting up a ldap test server automatically.  
8 -Some tests may not be running. If you want to fully test this plugin, please  
9 -setup the ldap test server and make the proper configurations on  
10 -fixtures/ldap.yml.\n\n"  
script/noosfero-plugins
@@ -97,6 +97,11 @@ _enable(){ @@ -97,6 +97,11 @@ _enable(){
97 else 97 else
98 dependencies_ok=true 98 dependencies_ok=true
99 dependencies_file="$source/dependencies.rb" 99 dependencies_file="$source/dependencies.rb"
  100 + if [ -e $source/Gemfile ]; then
  101 + if ! (cd $source && bundle --local); then
  102 + dependencies_ok=false
  103 + fi
  104 + fi
100 if ! run $dependencies_file; then 105 if ! run $dependencies_file; then
101 dependencies_ok=false 106 dependencies_ok=false
102 fi 107 fi
script/quick-start
1 #!/bin/sh 1 #!/bin/sh
2 2
  3 +set -e
  4 +
3 say() { 5 say() {
4 msg="$@" 6 msg="$@"
5 if [ -t 1 ]; then 7 if [ -t 1 ]; then
@@ -88,9 +90,12 @@ else @@ -88,9 +90,12 @@ else
88 # create the database with sample data 90 # create the database with sample data
89 say 'Configuring Noosfero to use PostgreSQL, with your user.' 91 say 'Configuring Noosfero to use PostgreSQL, with your user.'
90 run cp config/database.yml.pgsql config/database.yml 92 run cp config/database.yml.pgsql config/database.yml
  93 + if [ -z "$USER" ]; then
  94 + USER=$(stat -c %U $0)
  95 + fi
91 sed -ri "s/username: noosfero/username: $USER/" config/database.yml 96 sed -ri "s/username: noosfero/username: $USER/" config/database.yml
92 - sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole"  
93 - sudo su - postgres -c "createdb noosfero_development -O $USER" 97 + sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole" || true
  98 + sudo su - postgres -c "createdb noosfero_development -O $USER" || true
94 99
95 run rake db:schema:load 100 run rake db:schema:load
96 run rake db:data:minimal 101 run rake db:data:minimal
@@ -98,8 +103,7 @@ else @@ -98,8 +103,7 @@ else
98 rails runner 'Environment.default.enable("skip_new_user_email_confirmation")' 103 rails runner 'Environment.default.enable("skip_new_user_email_confirmation")'
99 fi 104 fi
100 105
101 -# FIXME compile translations depends on ruby-gettext-rails, please see debian/control  
102 -# run rake noosfero:translations:compile 106 +run 'rake noosfero:translations:compile >/dev/null 2>&1'
103 107
104 # create needed directory 108 # create needed directory
105 mkdir -p tmp/pids 109 mkdir -p tmp/pids
test/functional/admin_panel_controller_test.rb
@@ -130,11 +130,6 @@ class AdminPanelControllerTest < ActionController::TestCase @@ -130,11 +130,6 @@ class AdminPanelControllerTest < ActionController::TestCase
130 assert_equal "This <strong>is</strong> my new environment", Environment.default.message_for_disabled_enterprise 130 assert_equal "This <strong>is</strong> my new environment", Environment.default.message_for_disabled_enterprise
131 end 131 end
132 132
133 - should 'always use WYSIWYG' do  
134 - get :site_info  
135 - assert_tag :tag => "script", :content => /tinyMCE\.init/  
136 - end  
137 -  
138 should 'set portal community' do 133 should 'set portal community' do
139 e = Environment.default 134 e = Environment.default
140 @controller.stubs(:environment).returns(e) 135 @controller.stubs(:environment).returns(e)
test/functional/comment_controller_test.rb
@@ -314,7 +314,7 @@ class CommentControllerTest &lt; ActionController::TestCase @@ -314,7 +314,7 @@ class CommentControllerTest &lt; ActionController::TestCase
314 Time.stubs(:now).returns(now) 314 Time.stubs(:now).returns(now)
315 xhr :post, :create, :profile => community.identifier, :id => page.id, :comment => {:body => 'Some comment...'}, :confirm => 'true' 315 xhr :post, :create, :profile => community.identifier, :id => page.id, :comment => {:body => 'Some comment...'}, :confirm => 'true'
316 task = Task.last 316 task = Task.last
317 - assert_equal now.to_s, task.comment.created_at.to_s 317 + assert_equal now.utc.to_s, task.comment.created_at.utc.to_s
318 end 318 end
319 319
320 should "render_target be nil in article with moderation" do 320 should "render_target be nil in article with moderation" do
test/integration/http_caching_test.rb
@@ -9,6 +9,7 @@ class HttpCachingTest &lt; ActionController::IntegrationTest @@ -9,6 +9,7 @@ class HttpCachingTest &lt; ActionController::IntegrationTest
9 test 'home page, default configuration' do 9 test 'home page, default configuration' do
10 get '/' 10 get '/'
11 assert_cache(5.minutes) 11 assert_cache(5.minutes)
  12 + assert_no_cookies
12 end 13 end
13 14
14 test 'home page, custom config' do 15 test 'home page, custom config' do
@@ -91,6 +92,11 @@ class HttpCachingTest &lt; ActionController::IntegrationTest @@ -91,6 +92,11 @@ class HttpCachingTest &lt; ActionController::IntegrationTest
91 assert_no_cache 92 assert_no_cache
92 end 93 end
93 94
  95 + test 'user data, not logged in' do
  96 + get '/account/user_data', {}, { 'X-Requested-With' => 'XMLHttpRequest'}
  97 + assert_no_cookies
  98 + end
  99 +
94 protected 100 protected
95 101
96 def set_env_config(data) 102 def set_env_config(data)