spec_helper.rb 901 Bytes
Newer Older
1 2
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
Robert Speicher's avatar
Robert Speicher committed
3 4 5 6 7 8
require 'rspec/rails'
require 'email_spec'
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 17 18 19 20 21
  config.mock_with :rspec

  config.include LoginHelpers, type: :feature
  config.include LoginHelpers, type: :request
  config.include FactoryGirl::Syntax::Methods
  config.include Devise::TestHelpers, type: :controller

  config.include TestEnv
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!