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