diff --git a/tests/acceptance/signup_tests.rb b/tests/acceptance/signup_tests.rb index 6ae9d6bd..d8f4030c 100644 --- a/tests/acceptance/signup_tests.rb +++ b/tests/acceptance/signup_tests.rb @@ -7,18 +7,19 @@ end describe 'signup' do include Capybara::DSL - def wait_for_ajax - Timeout.timeout(Capybara.default_wait_time) do - loop until page.evaluate_script('jQuery.active').zero? - end - end - def fill_in_valid @site = Fabricate.attributes_for(:site) - wait_for_ajax - fill_in 'username', with: @site[:username] - fill_in 'password', with: @site[:password] - fill_in 'email', with: @site[:email] + + time = Time.now + begin + fill_in 'username', with: @site[:username] + fill_in 'password', with: @site[:password] + fill_in 'email', with: @site[:email] + rescue Capybara::ElementNotFound + raise if Time.now - time > 30 + sleep 0.5 + retry + end end def click_signup_button