spec_helper.rb 910 Bytes
Newer Older
1 2
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
Robert Speicher's avatar
Robert Speicher committed
3
require 'rspec/rails'
4
require 'shoulda/matchers'
Robert Speicher's avatar
Robert Speicher committed
5 6 7 8
require 'sidekiq/testing/inline'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
9
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
Robert Speicher's avatar
Robert Speicher committed
10 11

RSpec.configure do |config|
Jeroen van Baarsen's avatar
Jeroen van Baarsen committed
12 13
  config.use_transactional_fixtures = false
  config.use_instantiated_fixtures  = false
Robert Speicher's avatar
Robert Speicher committed
14 15 16
  config.mock_with :rspec

  config.include Devise::TestHelpers, type: :controller
17 18
  config.include LoginHelpers,        type: :feature
  config.include LoginHelpers,        type: :request
19
  config.include StubConfiguration
Robert Speicher's avatar
Robert Speicher committed
20
  config.include TestEnv
21

22
  config.infer_spec_type_from_file_location!
23
  config.raise_errors_for_deprecations!
Robert Speicher's avatar
Robert Speicher committed
24 25

  config.before(:suite) do
26
    TestEnv.init
Robert Speicher's avatar
Robert Speicher committed
27
  end
Andrew8xx8's avatar
Andrew8xx8 committed
28
end
29 30

ActiveRecord::Migration.maintain_test_schema!