Commit c034e703134c6e7d13908b6aa701846b4a8e8f4c

Authored by Hebert Santos
Committed by Tallys Martins
1 parent ba453de5

Fixed selenium tests and signup join in community check.

(AI3036)

Signed-off-by: André Bernardes <andrebsguedes@gmail.com>
Signed-off-by: Hebert Douglas <hebertdougl@gmail.com>
app/controllers/public/account_controller.rb
@@ -100,10 +100,9 @@ class AccountController &lt; ApplicationController @@ -100,10 +100,9 @@ class AccountController &lt; ApplicationController
100 @terms_of_use = environment.terms_of_use 100 @terms_of_use = environment.terms_of_use
101 @user.person_data = params[:profile_data] 101 @user.person_data = params[:profile_data]
102 @user.return_to = session[:return_to] 102 @user.return_to = session[:return_to]
103 - @person = Person.new 103 + @person = Person.new(params[:profile_data])
104 @person.environment = @user.environment 104 @person.environment = @user.environment
105 if request.post? 105 if request.post?
106 - @person.attributes = params[:profile_data]  
107 if may_be_a_bot 106 if may_be_a_bot
108 set_signup_start_time_for_now 107 set_signup_start_time_for_now
109 @block_bot = true 108 @block_bot = true
@@ -123,6 +122,7 @@ class AccountController &lt; ApplicationController @@ -123,6 +122,7 @@ class AccountController &lt; ApplicationController
123 end 122 end
124 if @user.activated? 123 if @user.activated?
125 self.current_user = @user 124 self.current_user = @user
  125 + check_join_in_community(@user)
126 go_to_signup_initial_page 126 go_to_signup_initial_page
127 else 127 else
128 @register_pending = true 128 @register_pending = true
features/signup.feature
@@ -302,14 +302,16 @@ Feature: signup @@ -302,14 +302,16 @@ Feature: signup
302 @selenium 302 @selenium
303 Scenario: user registration is moderated by admin 303 Scenario: user registration is moderated by admin
304 Given feature "admin_must_approve_new_users" is enabled on environment 304 Given feature "admin_must_approve_new_users" is enabled on environment
305 - And feature "skip_new_user_email_confirmation" is enabled on environment 305 + And feature "skip_new_user_email_confirmation" is disabled on environment
306 And I go to /account/signup 306 And I go to /account/signup
307 And I fill in "Username" with "teste" 307 And I fill in "Username" with "teste"
308 And I fill in "Password" with "123456" 308 And I fill in "Password" with "123456"
309 And I fill in "Password confirmation" with "123456" 309 And I fill in "Password confirmation" with "123456"
310 And I fill in "e-Mail" with "teste@teste.com" 310 And I fill in "e-Mail" with "teste@teste.com"
311 And I fill in "Full name" with "Teste da Silva" 311 And I fill in "Full name" with "Teste da Silva"
  312 + And wait for the captcha signup time
312 And I press "Create my account" 313 And I press "Create my account"
  314 + And I go to teste's confirmation URL
313 And I am logged in as admin 315 And I am logged in as admin
314 And I follow "Control panel" 316 And I follow "Control panel"
315 And I follow "Tasks" 317 And I follow "Tasks"
@@ -327,14 +329,16 @@ Feature: signup @@ -327,14 +329,16 @@ Feature: signup
327 @selenium 329 @selenium
328 Scenario: user registration is not accepted by the admin 330 Scenario: user registration is not accepted by the admin
329 Given feature "admin_must_approve_new_users" is enabled on environment 331 Given feature "admin_must_approve_new_users" is enabled on environment
330 - And feature "skip_new_user_email_confirmation" is enabled on environment 332 + And feature "skip_new_user_email_confirmation" is disabled on environment
331 And I go to /account/signup 333 And I go to /account/signup
332 And I fill in "Username" with "teste" 334 And I fill in "Username" with "teste"
333 And I fill in "Password" with "123456" 335 And I fill in "Password" with "123456"
334 And I fill in "Password confirmation" with "123456" 336 And I fill in "Password confirmation" with "123456"
335 And I fill in "e-Mail" with "teste@teste.com" 337 And I fill in "e-Mail" with "teste@teste.com"
336 And I fill in "Full name" with "Teste da Silva" 338 And I fill in "Full name" with "Teste da Silva"
  339 + And wait for the captcha signup time
337 And I press "Create my account" 340 And I press "Create my account"
  341 + And I go to teste's confirmation URL
338 And I am logged in as admin 342 And I am logged in as admin
339 And I follow "Control panel" 343 And I follow "Control panel"
340 And I follow "Tasks" 344 And I follow "Tasks"