|
1 | | -# frozen_string_literal: true |
2 | | -require 'coveralls' |
3 | | -Coveralls.wear! |
| 1 | +require 'simplecov' |
| 2 | +SimpleCov.start do |
| 3 | + add_filter '/spec/' |
| 4 | +end |
4 | 5 |
|
5 | 6 | $LOAD_PATH.unshift(File.dirname(__FILE__)) |
6 | 7 | $LOAD_PATH << File.expand_path('../support', __FILE__) |
|
10 | 11 | Bundler.setup |
11 | 12 |
|
12 | 13 | ENV['RAILS_ENV'] = 'test' |
13 | | -# Ensure the Active Admin load path is happy |
14 | 14 | require 'rails' |
15 | 15 | ENV['RAILS'] = Rails.version |
16 | 16 | ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV['RAILS']}", __FILE__) |
17 | | -# Create the test app if it doesn't exists |
18 | 17 | system 'rake setup' unless File.exist?(ENV['RAILS_ROOT']) |
19 | 18 |
|
20 | 19 | require 'active_model' |
21 | | -# require ActiveRecord to ensure that Ransack loads correctly |
22 | 20 | require 'active_record' |
23 | 21 | require 'action_view' |
24 | 22 | require 'active_admin' |
25 | 23 | ActiveAdmin.application.load_paths = [ENV['RAILS_ROOT'] + '/app/admin'] |
26 | 24 | require ENV['RAILS_ROOT'] + '/config/environment.rb' |
27 | | -# Disabling authentication in specs so that we don't have to worry about |
28 | | -# it allover the place |
29 | 25 | ActiveAdmin.application.authentication_method = false |
30 | 26 | ActiveAdmin.application.current_user_method = false |
31 | 27 |
|
32 | 28 | require 'rspec/rails' |
33 | 29 | require 'support/admin' |
34 | 30 | require 'capybara/rails' |
35 | 31 | require 'capybara/rspec' |
36 | | -require 'capybara/poltergeist' |
| 32 | +require 'capybara/cuprite' |
37 | 33 |
|
38 | | -Capybara.register_driver :poltergeist do |app| |
39 | | - Capybara::Poltergeist::Driver.new(app, js_errors: true, |
40 | | - timeout: 80, |
41 | | - debug: true, |
42 | | - phantomjs_options: ['--debug=no', '--load-images=no']) |
| 34 | +Capybara.server = :webrick |
| 35 | +Capybara.register_driver :cuprite do |app| |
| 36 | + Capybara::Cuprite::Driver.new(app, headless: true, window_size: [1280, 800]) |
43 | 37 | end |
44 | | - |
45 | | -Capybara.javascript_driver = :poltergeist |
| 38 | +Capybara.javascript_driver = :cuprite |
| 39 | +Capybara.default_max_wait_time = 5 |
46 | 40 |
|
47 | 41 | RSpec.configure do |config| |
48 | 42 | config.use_transactional_fixtures = false |
49 | 43 |
|
50 | 44 | config.before(:suite) do |
| 45 | + ActiveRecord::Migration.maintain_test_schema! |
51 | 46 | DatabaseCleaner.strategy = :truncation |
52 | 47 | DatabaseCleaner.clean_with(:truncation) |
53 | 48 | end |
|
0 commit comments