Commit 00821581c87840355f4526adec5a4d3de86b303a

Authored by Parley
Committed by Fabio Teixeira
1 parent e102c124

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>
features/user_registration.feature
... ... @@ -236,7 +236,7 @@ Feature: User Registration
236 236 And I fill in "Username" with "josesilva"
237 237 And I fill in "Password" with "secret"
238 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 241 @selenium
242 242 Scenario: Remove the incomplete resgistration percentage message
... ... @@ -260,7 +260,7 @@ Feature: User Registration
260 260 And I fill in "Password" with "secret"
261 261 And I press "Log in"
262 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 265 @selenium
266 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 268 | login | name | email | country | state | city |
269 269 | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
270 270 When I am logged in as "maria"
  271 + And I should see "Complete Profile:"
271 272 And I follow "Logout"
272 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 276 @selenium
276 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 280 | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
280 281 When I am logged in as "maria"
281 282 And I go to /profile/maria
282   - And I should see "Percentage incomplete:"
  283 + And I should see "Complete Profile:"
283 284 And I click on anything with selector ".hide-incomplete-percentage"
  285 + And I should not see "Complete Profile"
284 286 And I follow "Logout"
285 287 And I am logged in as "maria"
286 288 And I go to /profile/maria
287   - Then I should see "Percentage incomplete:"
  289 + Then I should see "Complete Profile:"
288 290  
289 291 @selenium
290 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 295 | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
294 296 When I am logged in as "maria"
295 297 And I go to /profile/maria
296   - And I should see "Percentage incomplete:"
  298 + And I should see "Complete Profile"
297 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 301 And I go to /myprofile/maria/profile_editor/edit
  302 + And I should not see "Complete Profile"
300 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 306 @selenium-fixme
304 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 309 | login | name | email | country | state | city |
307 310 | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
308 311 When I am logged in as "maria"
309   - And I follow "Percentage incomplete: 72 %"
  312 + And I follow "Complete your profile"
310 313 Then I should see "Profile settings"
... ...
test/functional/mpog_software_plugin_controller_test.rb
... ... @@ -95,6 +95,16 @@ class MpogSoftwarePluginControllerTest &lt; ActionController::TestCase
95 95 assert_equal "name;acronym;demonstration_url;e_arq;e_mag;e_ping;features;icp_brasil;objectives;operating_platform\n", @response.body
96 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 109 private
100 110  
... ...