rails_helper.rb 1.4 KB

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. # This file is copied to spec/ when you run 'rails generate rspec:install'
  3. ENV['RAILS_ENV'] ||= 'test'
  4. require File.expand_path('../config/environment', __dir__)
  5. # Prevent database truncation if the environment is production
  6. abort('The Rails environment is running in production mode!') if Rails.env.production?
  7. require 'spec_helper'
  8. require 'rspec/rails'
  9. # Add additional requires below this line. Rails is not loaded until this point!
  10. # Requires supporting ruby files with custom matchers and macros, etc, in
  11. # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
  12. # run as spec files by default. This means that files in spec/support that end
  13. # in _spec.rb will both be required and run as specs, causing the specs to be
  14. # run twice. It is recommended that you do not name files matching this glob to
  15. # end with _spec.rb. You can configure this pattern with the --pattern
  16. # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
  17. #
  18. # The following line is provided for convenience purposes. It has the downside
  19. # of increasing the boot-up time by auto-requiring all files in the support
  20. # directory. Alternatively, in the individual `*_spec.rb` files, manually
  21. # require only the support files necessary.
  22. #
  23. Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }