Skip to content

Instantly share code, notes, and snippets.

View synth's full-sized avatar

Peter Philips synth

View GitHub Profile
@synth
synth / gist:3292441
Created August 8, 2012 05:29
Sometimes you need to slow down Capybara until certain things have loaded(like javascript assets loaded with RequireJS), here's a solution I came up with:
#/spec/support/asynchronous_helper.rb
module AsynchronousHelper
def wait_until_remote_events_are_bound
page.wait_until do
page.evaluate_script("typeof($assetsloaded) === 'object'")
end
end
def wait_until_overlay_has_popped_up