Increase capybara/poltergeist timeout to 60 seconds

The default wait time of 2 seconds produced false positives on slow test runners.

Dominik Sander 9 年之前
父節點
當前提交
43463b5518
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      spec/capybara_helper.rb

+ 7 - 1
spec/capybara_helper.rb

@@ -2,7 +2,13 @@ require 'rails_helper'
2 2
 require 'capybara/rails'
3 3
 require 'capybara/poltergeist'
4 4
 require 'capybara-select2'
5
+
6
+Capybara.register_driver :poltergeist do |app|
7
+  Capybara::Poltergeist::Driver.new(app, timeout: 60)
8
+end
9
+
5 10
 Capybara.javascript_driver = :poltergeist
11
+Capybara.default_max_wait_time = 60
6 12
 
7 13
 RSpec.configure do |config|
8 14
   config.include Warden::Test::Helpers
@@ -17,4 +23,4 @@ end
17 23
 
18 24
 VCR.configure do |config|
19 25
   config.ignore_localhost = true
20
-end
26
+end