Joined May 2011
·

Ancor Cruz

Santa Cruz de Tenerife, Spain
·
·
·

Posted to Wait for ajax with capybara 2.0 over 1 year ago

Thanks for share.
I would like to add my 2 cents with a DRY version of your code.

def wait_for_ajax
  Timeout.timeout(Capybara.default_wait_time) do
    loop do
      active = page.evaluate_script('jQuery.active')
      break if active == 0
    end
  end
end
Achievements
56 Karma
0 Total ProTip Views