diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-04-04 16:12:05 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-04-19 20:28:32 -0400 |
commit | 5647d5deaf5a05da1cb0a75984859c61682a1c1b (patch) | |
tree | 1957cc6b6f17fdf302e393c1117337a85c8c1e9a /spec | |
parent | 40ba2f7d207a16376908ea0f6db6699808aa29e2 (diff) | |
download | gitlab-ce-5647d5deaf5a05da1cb0a75984859c61682a1c1b.tar.gz |
Simplify the `javascript_test?` helper
Also don't try to run `page.evaluate_script` when we're not in a
JavaScript test.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/wait_for_ajax.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/wait_for_ajax.rb b/spec/support/wait_for_ajax.rb index 0f9dc2dee75..d10c265c336 100644 --- a/spec/support/wait_for_ajax.rb +++ b/spec/support/wait_for_ajax.rb @@ -6,10 +6,12 @@ module WaitForAjax end def finished_all_ajax_requests? + return true unless javascript_test? + page.evaluate_script('jQuery.active').zero? end def javascript_test? - [:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver) + Capybara.current_driver == Capybara.javascript_driver end end |