Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This file is copied to spec/ when you run 'rails generate rspec:install'
- require 'spec_helper'
- require 'devise'
- require 'capybara/rspec'
- require 'database_cleaner'
- require 'controller_helper'
- ENV['RAILS_ENV'] ||= 'test'
- require File.expand_path('../../config/environment', __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'
- ActiveRecord::Migration.maintain_test_schema!
- DatabaseCleaner.strategy = :transaction
- RSpec.configure do |config|
- config.include Devise::Test::ControllerHelpers, :type => :controller
- config.include FactoryBot::Syntax::Methods
- config.include ControllerHelper
- [:controller, :view, :request].each do |type|
- config.include ::Rails::Controller::Testing::TestProcess, :type => type
- config.include ::Rails::Controller::Testing::TemplateAssertions, :type => type
- config.include ::Rails::Controller::Testing::Integration, :type => type
- end
- end
Add Comment
Please, Sign In to add comment