2020-07-20 16:30:47 +00:00
|
|
|
require 'rubygems'
|
|
|
|
require 'bundler/setup'
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
# Coverage
|
|
|
|
require 'simplecov'
|
|
|
|
SimpleCov.start do
|
|
|
|
add_filter '/spec/'
|
|
|
|
end
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
require_relative "dummy/config/environment"
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
require 'rails/all'
|
|
|
|
require 'rspec/rails'
|
|
|
|
# require 'capybara/rails'
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
require 'friendly_id'
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../spec/dummy/db/migrate", __dir__)]
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
require "rails/test_help"
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
|
|
RSpec.configure do |config|
|
|
|
|
config.fixture_path = "spec/fixtures"
|
|
|
|
config.infer_spec_type_from_file_location!
|
|
|
|
|
|
|
|
config.mock_with :rspec
|
|
|
|
config.use_transactional_fixtures = true
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
# excludes migration tag while running app base tests
|
|
|
|
config.filter_run_excluding :migration => true
|
2020-07-20 13:35:41 +00:00
|
|
|
|
2020-07-20 16:30:47 +00:00
|
|
|
# self explanatory
|
|
|
|
# runs everything
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
|
|
|
# make the rails logger usable in the tests as logger.xxx "..."
|
|
|
|
def logger
|
|
|
|
Rails.logger
|
|
|
|
end
|
2020-07-20 13:35:41 +00:00
|
|
|
end
|