Sha256: aad4d5ad67d84534f9326bb5383d4f67c378d40da181dc119ff8d9a24658c5a4
Contents?: true
Size: 1.42 KB
Versions: 33
Compression:
Stored size: 1.42 KB
Contents
# This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } # Add this at top of file # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? require 'rspec/rails' require 'spec_helper' require 'support/factory_bot' Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } RSpec.configure do |config| # Add create_and_sign_in_user config.include AuthenticationHelper, type: :controller # To include RequestSpecHelper config.include RequestSpecHelper, type: :request # config.infer_spec_type_from_file_location! # Filter lines from Rails gems in backtraces. config.filter_rails_from_backtrace! # arbitrary gems may also be filtered via: # config.filter_gems_from_backtrace("gem name") # Added to make factorybot work # FactoryBot.allow_class_lookup = false config.use_transactional_fixtures = false config.include FactoryBot::Syntax::Methods config.before do FactoryBot.find_definitions end # configure shoulda matchers to use rspec as the test framework and full matcher libraries for rails Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end end
Version data entries
33 entries across 33 versions & 2 rubygems