From f47fc9d6522886cf81cfea26ec1f396219c539ba Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 23 May 2016 12:17:31 +0200 Subject: move signup from users to account_controller There was a lot of special case handling going on in the users_controller for this. Lot simpler this way. --- test/support/browser_integration_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/support/browser_integration_test.rb') diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb index 84440a1..70161f9 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -52,7 +52,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest username ||= "test_#{SecureRandom.urlsafe_base64}".downcase password ||= SecureRandom.base64 - visit '/users/new' + visit '/signup' fill_in 'Username', with: username fill_in 'Password', with: password fill_in 'Invite code', with: @testcode.invite_code @@ -65,7 +65,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest username ||= "test_#{SecureRandom.urlsafe_base64}".downcase password ||= SecureRandom.base64 - visit '/users/new' + visit '/signup' fill_in 'Username', with: username fill_in 'Password', with: password fill_in 'Password confirmation', with: password -- cgit v1.2.3 From 30da8e6ffa1eefafb9762645efb85e0beed236c6 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 23 May 2016 12:53:23 +0200 Subject: fix config check in submit_signup with_config is not mean to test the current config. It will set the config. So instead we need to look into APP_CONFIG. --- test/support/browser_integration_test.rb | 33 +++++++++----------------------- 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'test/support/browser_integration_test.rb') diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb index 70161f9..1f5e3d2 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -47,32 +47,17 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest end def submit_signup(username = nil, password = nil) - - with_config invite_required: true do - - username ||= "test_#{SecureRandom.urlsafe_base64}".downcase - password ||= SecureRandom.base64 - visit '/signup' - fill_in 'Username', with: username - fill_in 'Password', with: password + username ||= "test_#{SecureRandom.urlsafe_base64}".downcase + password ||= SecureRandom.base64 + visit '/signup' + fill_in 'Username', with: username + fill_in 'Password', with: password + if APP_CONFIG[:invite_required] fill_in 'Invite code', with: @testcode.invite_code - fill_in 'Password confirmation', with: password - click_on 'Sign Up' - return username, password - end - - with_config invite_required: false do - - username ||= "test_#{SecureRandom.urlsafe_base64}".downcase - password ||= SecureRandom.base64 - visit '/signup' - fill_in 'Username', with: username - fill_in 'Password', with: password - fill_in 'Password confirmation', with: password - click_on 'Sign Up' - return username, password end - + fill_in 'Password confirmation', with: password + click_on 'Sign Up' + return username, password end # currently this only works for tests with poltergeist. -- cgit v1.2.3