From 52a6dc82305f0268684ceb10557773b862bc611c Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Mar 2016 08:54:38 +0100 Subject: fix browser_integration_test we need to require 'capybara/rails' so that Capybara::DSL is available. ActionController::RecordIdentifier was moved to ActionView --- test/support/browser_integration_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 1deb8fa..5455fba 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -3,10 +3,11 @@ # # Use this class for capybara based integration tests for the ui. # +require 'capybara/rails' class BrowserIntegrationTest < ActionDispatch::IntegrationTest # let's use dom_id inorder to identify sections - include ActionController::RecordIdentifier + include ActionView::RecordIdentifier CONFIG_RU = (Rails.root + 'config.ru').to_s OUTER_APP = Rack::Builder.parse_file(CONFIG_RU).first -- cgit v1.2.3 From 9b9daf95357f4fa5fd1eb95b16e2cf043937bdc0 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Mar 2016 11:12:55 +0100 Subject: upgrade: default_wait_time -> default_max_wait_time --- test/support/browser_integration_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 5455fba..8201854 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -29,7 +29,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest Capybara.app_host = 'http://lvh.me:3003' Capybara.server_port = 3003 Capybara.javascript_driver = :poltergeist - Capybara.default_wait_time = 5 + Capybara.default_max_wait_time = 5 # Make the Capybara DSL available include Capybara::DSL -- cgit v1.2.3 From 931748ab96aea54e123b0fffd3f12c87bd647fed Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Mar 2016 14:30:41 +0100 Subject: upgrade: test cases now have #name --- test/support/browser_integration_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 8201854..84440a1 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -102,7 +102,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest File.open(logfile_path, 'w') do |test_log| test_log.puts self.class.name test_log.puts "=========================" - test_log.puts __name__ + test_log.puts name test_log.puts Time.now test_log.puts current_path test_log.puts page.status_code -- cgit v1.2.3 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