Sha256: b60c27c91ec31e84e0eca3e2e3ad714776ebbc75c4a9d9664a874bfc30284f5a

Contents?: true

Size: 426 Bytes

Versions: 1

Compression:

Stored size: 426 Bytes

Contents

# Original code is came from https://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara

module WaitForAjax
  def wait_for_ajax
    Timeout.timeout(Capybara.default_max_wait_time) do
      sleep 0.1 until finished_all_ajax_requests?
    end
  end

  def finished_all_ajax_requests?
    evaluate_script('jQuery.active').zero?
  end
end

RSpec.configure do |config|
  config.include WaitForAjax, type: :feature
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daimon-exhibition-0.1.0 spec/support/wait_for_ajax.rb