Guest User

Untitled

a guest
Aug 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. # This file is copied to spec/ when you run 'rails generate rspec:install'
  2. require 'spec_helper'
  3. require 'devise'
  4. require 'capybara/rspec'
  5. require 'database_cleaner'
  6. require 'controller_helper'
  7.  
  8. ENV['RAILS_ENV'] ||= 'test'
  9. require File.expand_path('../../config/environment', __FILE__)
  10. # Prevent database truncation if the environment is production
  11. abort("The Rails environment is running in production mode!") if Rails.env.production?
  12. require 'rspec/rails'
  13. ActiveRecord::Migration.maintain_test_schema!
  14.  
  15. DatabaseCleaner.strategy = :transaction
  16.  
  17. RSpec.configure do |config|
  18. config.include Devise::Test::ControllerHelpers, :type => :controller
  19. config.include FactoryBot::Syntax::Methods
  20. config.include ControllerHelper
  21. [:controller, :view, :request].each do |type|
  22. config.include ::Rails::Controller::Testing::TestProcess, :type => type
  23. config.include ::Rails::Controller::Testing::TemplateAssertions, :type => type
  24. config.include ::Rails::Controller::Testing::Integration, :type => type
  25. end
  26. end
Add Comment
Please, Sign In to add comment