ENV['RAILS_ENV'] ||= 'test'
ENV['PAGEFLOW_PLUGIN_ENGINE'] = 'pageflow_scrolled'

require 'pageflow/support'
Pageflow::Dummy.setup

require 'rspec/rails'
require 'rspec/collection_matchers'
require 'rspec/json_expectations'

Dir[File.join(File.dirname(__FILE__), 'support/{config,helpers}/**/*.rb')].each do |file|
  require(file)
end

require 'pageflow/support/config/capybara'
require 'pageflow/support/config/paperclip'
require 'pageflow/support/config/webmock'
require 'pageflow_scrolled'

RSpec.configure do |config|
  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = '.rspec_status'

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

ENV['RAILS_ENV'] ||= 'test'
ENV['PAGEFLOW_PLUGIN_ENGINE'] = 'pageflow_scrolled'

require 'pageflow/support'
Pageflow::Dummy.setup

require 'rspec/rails'
require 'rspec/collection_matchers'
require 'rspec/json_expectations'

Dir[File.join(File.dirname(__FILE__), 'support/{config,helpers}/**/*.rb')].each do |file|
  require(file)
end

require 'pageflow/support/config/capybara'
require 'pageflow/support/config/paperclip'
require 'pageflow/support/config/webmock'
require 'pageflow_scrolled'

# see REDMINE-17430
Webdrivers::Chromedriver.required_version = '79.0.3945.36'

RSpec.configure do |config|
  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = '.rspec_status'

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

Fix Capybara Readtimeout error on Travis
Fix Capybara Readtimeout error on Travis

Starting with chromedriver 80 switching between frames can cause
`Timed out receiving message from renderer` errors. [1]

Downgrade to 79 as a workaround.

[1] https://bugs.chromium.org/p/chromedriver/issues/detail?id=3335&q=Timed%20out%20receiving%20message%20from%20renderer%3A&can=2

REDMINE-17430
