Commit 5647d5de authored by Robert Speicher's avatar Robert Speicher

Simplify the `javascript_test?` helper

Also don't try to run `page.evaluate_script` when we're not in a
JavaScript test.
parent 40ba2f7d
...@@ -6,10 +6,12 @@ module WaitForAjax ...@@ -6,10 +6,12 @@ module WaitForAjax
end end
def finished_all_ajax_requests? def finished_all_ajax_requests?
return true unless javascript_test?
page.evaluate_script('jQuery.active').zero? page.evaluate_script('jQuery.active').zero?
end end
def javascript_test? def javascript_test?
[:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver) Capybara.current_driver == Capybara.javascript_driver
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment