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