Commit 00821581c87840355f4526adec5a4d3de86b303a
Committed by
Fabio Teixeira
1 parent
e102c124
Exists in
master
and in
5 other branches
incomplete_registration: Cucumber and functional tests to incomplete profile message.
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
2 changed files
with
22 additions
and
9 deletions
Show diff stats
features/user_registration.feature
@@ -236,7 +236,7 @@ Feature: User Registration | @@ -236,7 +236,7 @@ Feature: User Registration | ||
236 | And I fill in "Username" with "josesilva" | 236 | And I fill in "Username" with "josesilva" |
237 | And I fill in "Password" with "secret" | 237 | And I fill in "Password" with "secret" |
238 | And I press "Log in" | 238 | And I press "Log in" |
239 | - Then I should see "Percentage incomplete: 63 %" | 239 | + Then I should see "Complete Profile: 37%" |
240 | 240 | ||
241 | @selenium | 241 | @selenium |
242 | Scenario: Remove the incomplete resgistration percentage message | 242 | Scenario: Remove the incomplete resgistration percentage message |
@@ -260,7 +260,7 @@ Feature: User Registration | @@ -260,7 +260,7 @@ Feature: User Registration | ||
260 | And I fill in "Password" with "secret" | 260 | And I fill in "Password" with "secret" |
261 | And I press "Log in" | 261 | And I press "Log in" |
262 | And I click on anything with selector ".hide-incomplete-percentage" | 262 | And I click on anything with selector ".hide-incomplete-percentage" |
263 | - Then I should not see "Percentage incomplete: 63 %" | 263 | + Then I should not see "Complete Profile: 37%" |
264 | 264 | ||
265 | @selenium | 265 | @selenium |
266 | Scenario: When the user log out and log in again, the percentage registration message must appear | 266 | Scenario: When the user log out and log in again, the percentage registration message must appear |
@@ -268,9 +268,10 @@ Feature: User Registration | @@ -268,9 +268,10 @@ Feature: User Registration | ||
268 | | login | name | email | country | state | city | | 268 | | login | name | email | country | state | city | |
269 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | | 269 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | |
270 | When I am logged in as "maria" | 270 | When I am logged in as "maria" |
271 | + And I should see "Complete Profile:" | ||
271 | And I follow "Logout" | 272 | And I follow "Logout" |
272 | And I am logged in as "maria" | 273 | And I am logged in as "maria" |
273 | - Then I should see "Percentage incomplete:" | 274 | + Then I should see "Complete Profile:" |
274 | 275 | ||
275 | @selenium | 276 | @selenium |
276 | Scenario: When the user logged in and hide link of imcomplete percentage and user log out and log in again, the percentage registration link must appear | 277 | Scenario: When the user logged in and hide link of imcomplete percentage and user log out and log in again, the percentage registration link must appear |
@@ -279,12 +280,13 @@ Feature: User Registration | @@ -279,12 +280,13 @@ Feature: User Registration | ||
279 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | | 280 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | |
280 | When I am logged in as "maria" | 281 | When I am logged in as "maria" |
281 | And I go to /profile/maria | 282 | And I go to /profile/maria |
282 | - And I should see "Percentage incomplete:" | 283 | + And I should see "Complete Profile:" |
283 | And I click on anything with selector ".hide-incomplete-percentage" | 284 | And I click on anything with selector ".hide-incomplete-percentage" |
285 | + And I should not see "Complete Profile" | ||
284 | And I follow "Logout" | 286 | And I follow "Logout" |
285 | And I am logged in as "maria" | 287 | And I am logged in as "maria" |
286 | And I go to /profile/maria | 288 | And I go to /profile/maria |
287 | - Then I should see "Percentage incomplete:" | 289 | + Then I should see "Complete Profile:" |
288 | 290 | ||
289 | @selenium | 291 | @selenium |
290 | Scenario: When the user logged in and hide link of imcomplete percentage and user update page, the percentage registration link must not appear | 292 | Scenario: When the user logged in and hide link of imcomplete percentage and user update page, the percentage registration link must not appear |
@@ -293,12 +295,13 @@ Feature: User Registration | @@ -293,12 +295,13 @@ Feature: User Registration | ||
293 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | | 295 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | |
294 | When I am logged in as "maria" | 296 | When I am logged in as "maria" |
295 | And I go to /profile/maria | 297 | And I go to /profile/maria |
296 | - And I should see "Percentage incomplete:" | 298 | + And I should see "Complete Profile" |
297 | And I click on anything with selector ".hide-incomplete-percentage" | 299 | And I click on anything with selector ".hide-incomplete-percentage" |
298 | - And I should not see "Percentage incomplete:" | 300 | + And I should not see "Complete Profile" |
299 | And I go to /myprofile/maria/profile_editor/edit | 301 | And I go to /myprofile/maria/profile_editor/edit |
302 | + And I should not see "Complete Profile" | ||
300 | And I go to /profile/maria | 303 | And I go to /profile/maria |
301 | - Then I should not see "Percentage incomplete:" | 304 | + Then I should not see "Complete Profile" |
302 | 305 | ||
303 | @selenium-fixme | 306 | @selenium-fixme |
304 | Scenario: When the user press incomplete percentage link,he must be redirect to his edit profile page | 307 | Scenario: When the user press incomplete percentage link,he must be redirect to his edit profile page |
@@ -306,5 +309,5 @@ Feature: User Registration | @@ -306,5 +309,5 @@ Feature: User Registration | ||
306 | | login | name | email | country | state | city | | 309 | | login | name | email | country | state | city | |
307 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | | 310 | | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia | |
308 | When I am logged in as "maria" | 311 | When I am logged in as "maria" |
309 | - And I follow "Percentage incomplete: 72 %" | 312 | + And I follow "Complete your profile" |
310 | Then I should see "Profile settings" | 313 | Then I should see "Profile settings" |
test/functional/mpog_software_plugin_controller_test.rb
@@ -95,6 +95,16 @@ class MpogSoftwarePluginControllerTest < ActionController::TestCase | @@ -95,6 +95,16 @@ class MpogSoftwarePluginControllerTest < ActionController::TestCase | ||
95 | assert_equal "name;acronym;demonstration_url;e_arq;e_mag;e_ping;features;icp_brasil;objectives;operating_platform\n", @response.body | 95 | assert_equal "name;acronym;demonstration_url;e_arq;e_mag;e_ping;features;icp_brasil;objectives;operating_platform\n", @response.body |
96 | end | 96 | end |
97 | 97 | ||
98 | + should "hide registration incomplete message" do | ||
99 | + xhr :get, :hide_registration_incomplete_percentage, :hide=>true | ||
100 | + assert_equal "true", @response.body | ||
101 | + end | ||
102 | + | ||
103 | + should "not hide registration incomplete message" do | ||
104 | + xhr :get, :hide_registration_incomplete_percentage, :hide=>false | ||
105 | + assert_equal "false", @response.body | ||
106 | + end | ||
107 | + | ||
98 | 108 | ||
99 | private | 109 | private |
100 | 110 |