main
1# This file is copied to spec/ when you run 'rails generate rspec:install'
2ENV['RAILS_ENV'] ||= 'test'
3require 'spec_helper'
4require File.expand_path('../../config/environment', __FILE__)
5require 'rspec/rails'
6# Add additional requires below this line. Rails is not loaded until this point!
7
8# Requires supporting ruby files with custom matchers and macros, etc, in
9# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
10# run as spec files by default. This means that files in spec/support that end
11# in _spec.rb will both be required and run as specs, causing the specs to be
12# run twice. It is recommended that you do not name files matching this glob to
13# end with _spec.rb. You can configure this pattern with the --pattern
14# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
15#
16# The following line is provided for convenience purposes. It has the downside
17# of increasing the boot-up time by auto-requiring all files in the support
18# directory. Alternatively, in the individual `*_spec.rb` files, manually
19# require only the support files necessary.
20#
21Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
22
23# Checks for pending migrations before tests are run.
24# If you are not using ActiveRecord, you can remove this line.
25ActiveRecord::Migration.maintain_test_schema!
26
27RSpec.configure do |config|
28 # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
29 config.fixture_path = "#{::Rails.root}/spec/fixtures"
30
31 # If you're not using ActiveRecord, or you'd prefer not to run each of your
32 # examples within a transaction, remove the following line or assign false
33 # instead of true.
34 config.use_transactional_fixtures = false
35
36 # RSpec Rails can automatically mix in different behaviours to your tests
37 # based on their file location, for example enabling you to call `get` and
38 # `post` in specs under `spec/controllers`.
39 #
40 # You can disable this behaviour by removing the line below, and instead
41 # explicitly tag your specs with their type, e.g.:
42 #
43 # RSpec.describe UsersController, :type => :controller do
44 # # ...
45 # end
46 #
47 # The different available types are documented in the features, such as in
48 # https://relishapp.com/rspec/rspec-rails/docs
49 config.infer_spec_type_from_file_location!
50end