metamaps--metamaps/spec/rails_helper.rb

29 lines
866 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
2017-11-25 19:23:47 +00:00
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
2015-12-16 14:33:29 +00:00
# Prevent database truncation if the environment is production
2015-12-16 14:33:29 +00:00
if Rails.env.production?
abort('The Rails environment is running in production mode!')
end
# require all support files
2018-01-21 22:21:00 +00:00
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
2018-01-21 22:21:00 +00:00
config.fixture_path = ::Rails.root.join('spec', 'fixtures')
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
2015-12-17 01:16:02 +00:00
config.include Shoulda::Matchers::ActiveModel, type: :model
config.include Shoulda::Matchers::ActiveRecord, type: :model
end