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

Version Path
jinda-0.7.5.3 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.5.2 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.5.0 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.3 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.2 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.1 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.0.4 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.0.3 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.0.2 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.0.1 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.7.0 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.9 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.8 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.7 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.5 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.4 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.3 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.2 lib/generators/jinda/templates/spec/rails_helper.rb
jinda-0.6.1 lib/generators/jinda/templates/spec/rails_helper.rb
jinda_engine-0.6.0 lib/generators/jinda_engine/templates/spec/rails_helper.rb