2809: Add wait_for_ajax after submitting forms, to avoid race condition.
authorTom Clegg <tom@curoverse.com>
Wed, 14 May 2014 18:21:05 +0000 (14:21 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 15 May 2014 18:18:21 +0000 (14:18 -0400)
apps/workbench/test/integration/users_test.rb

index 6df7ee3a612f89785559067c60de381ccb061299..a019ec77d57e20431ed22bb5a328dd3f417ba060 100644 (file)
@@ -63,6 +63,7 @@ class UsersTest < ActionDispatch::IntegrationTest
       fill_in "email", :with => "foo@example.com"
       fill_in "repo_name", :with => "test_repo"
       click_button "Submit"
+      wait_for_ajax
     end
 
     visit '/users'
@@ -119,6 +120,7 @@ class UsersTest < ActionDispatch::IntegrationTest
       assert has_text? 'Virtual Machine'
       fill_in "repo_name", :with => "test_repo"
       click_button "Submit"
+      wait_for_ajax
     end
 
     sleep(1)
@@ -138,6 +140,7 @@ class UsersTest < ActionDispatch::IntegrationTest
       fill_in "repo_name", :with => "second_test_repo"
       select("testvm.shell", :from => 'vm_uuid')
       click_button "Submit"
+      wait_for_ajax
     end
 
     sleep(0.1)
@@ -203,6 +206,7 @@ class UsersTest < ActionDispatch::IntegrationTest
       fill_in "repo_name", :with => "second_test_repo"
       select("testvm.shell", :from => 'vm_uuid')
       click_button "Submit"
+      wait_for_ajax
     end
 
     sleep(0.1)