2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
require './spec/simplecov_env'
|
|
|
|
SimpleCovEnv.start!
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
ENV["RAILS_ENV"] = 'test'
|
2017-08-17 22:00:37 +05:30
|
|
|
ENV["IN_MEMORY_APPLICATION_SETTINGS"] = 'true'
|
2019-07-31 22:56:46 +05:30
|
|
|
ENV["RSPEC_ALLOW_INVALID_URLS"] = 'true'
|
2015-09-11 14:41:01 +05:30
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
require File.expand_path('../config/environment', __dir__)
|
2014-09-02 18:07:02 +05:30
|
|
|
require 'rspec/rails'
|
2015-09-11 14:41:01 +05:30
|
|
|
require 'shoulda/matchers'
|
2016-06-02 11:05:42 +05:30
|
|
|
require 'rspec/retry'
|
2018-03-17 18:26:18 +05:30
|
|
|
require 'rspec-parameterized'
|
2019-12-21 20:55:43 +05:30
|
|
|
require 'test_prof/recipes/rspec/let_it_be'
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
rspec_profiling_is_configured =
|
2017-09-10 17:25:29 +05:30
|
|
|
ENV['RSPEC_PROFILING_POSTGRES_URL'].present? ||
|
2017-08-17 22:00:37 +05:30
|
|
|
ENV['RSPEC_PROFILING']
|
|
|
|
branch_can_be_profiled =
|
|
|
|
(ENV['CI_COMMIT_REF_NAME'] == 'master' ||
|
|
|
|
ENV['CI_COMMIT_REF_NAME'] =~ /rspec-profile/)
|
|
|
|
|
|
|
|
if rspec_profiling_is_configured && (!ENV.key?('CI') || branch_can_be_profiled)
|
|
|
|
require 'rspec_profiling/rspec'
|
|
|
|
end
|
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
if ENV['CI'] && ENV['KNAPSACK_GENERATE_REPORT'] && !ENV['NO_KNAPSACK']
|
2016-06-16 23:09:34 +05:30
|
|
|
require 'knapsack'
|
|
|
|
Knapsack::Adapters::RSpecAdapter.bind
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
# require rainbow gem String monkeypatch, so we can test SystemChecks
|
|
|
|
require 'rainbow/ext/string'
|
2018-11-20 20:47:30 +05:30
|
|
|
Rainbow.enabled = false
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require_relative('../ee/spec/spec_helper') if Gitlab.ee?
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
|
|
# in spec/support/ and its subdirectories.
|
2018-10-15 14:42:47 +05:30
|
|
|
# Requires helpers, and shared contexts/examples first since they're used in other support files
|
2018-12-05 23:21:45 +05:30
|
|
|
|
|
|
|
# Load these first since they may be required by other helpers
|
|
|
|
require Rails.root.join("spec/support/helpers/git_helpers.rb")
|
|
|
|
|
|
|
|
# Then the rest
|
2018-10-15 14:42:47 +05:30
|
|
|
Dir[Rails.root.join("spec/support/helpers/*.rb")].each { |f| require f }
|
|
|
|
Dir[Rails.root.join("spec/support/shared_contexts/*.rb")].each { |f| require f }
|
|
|
|
Dir[Rails.root.join("spec/support/shared_examples/*.rb")].each { |f| require f }
|
2015-09-11 14:41:01 +05:30
|
|
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
quality_level = Quality::TestLevel.new
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
RSpec.configure do |config|
|
2019-10-12 21:52:04 +05:30
|
|
|
config.filter_run focus: true
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
config.use_transactional_fixtures = true
|
2014-09-02 18:07:02 +05:30
|
|
|
config.use_instantiated_fixtures = false
|
2018-11-20 20:47:30 +05:30
|
|
|
config.fixture_path = Rails.root
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
config.verbose_retry = true
|
|
|
|
config.display_try_failure_messages = true
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
config.infer_spec_type_from_file_location!
|
2019-07-31 22:56:46 +05:30
|
|
|
config.full_backtrace = !!ENV['CI']
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
unless ENV['CI']
|
|
|
|
# Re-run failures locally with `--only-failures`
|
|
|
|
config.example_status_persistence_file_path = './spec/examples.txt'
|
|
|
|
end
|
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
config.define_derived_metadata(file_path: %r{(ee)?/spec/.+_spec\.rb\z}) do |metadata|
|
2018-03-17 18:26:18 +05:30
|
|
|
location = metadata[:location]
|
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
metadata[:level] = quality_level.level_for(location)
|
2018-03-17 18:26:18 +05:30
|
|
|
metadata[:api] = true if location =~ %r{/spec/requests/api/}
|
|
|
|
|
|
|
|
# do not overwrite type if it's already set
|
|
|
|
next if metadata.key?(:type)
|
|
|
|
|
|
|
|
match = location.match(%r{/spec/([^/]+)/})
|
|
|
|
metadata[:type] = match[1].singularize.to_sym if match
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
config.include LicenseHelpers
|
2018-10-15 14:42:47 +05:30
|
|
|
config.include ActiveJob::TestHelper
|
|
|
|
config.include ActiveSupport::Testing::TimeHelpers
|
|
|
|
config.include CycleAnalyticsHelpers
|
|
|
|
config.include ExpectOffense
|
|
|
|
config.include FactoryBot::Syntax::Methods
|
|
|
|
config.include FixtureHelpers
|
|
|
|
config.include GitlabRoutingHelper
|
|
|
|
config.include StubFeatureFlags
|
2019-12-21 20:55:43 +05:30
|
|
|
config.include StubExperiments
|
2018-10-15 14:42:47 +05:30
|
|
|
config.include StubGitlabCalls
|
|
|
|
config.include StubGitlabData
|
2019-12-21 20:55:43 +05:30
|
|
|
config.include NextInstanceOf
|
2018-10-15 14:42:47 +05:30
|
|
|
config.include TestEnv
|
|
|
|
config.include Devise::Test::ControllerHelpers, type: :controller
|
|
|
|
config.include Devise::Test::IntegrationHelpers, type: :feature
|
|
|
|
config.include LoginHelpers, type: :feature
|
|
|
|
config.include SearchHelpers, type: :feature
|
2019-07-31 22:56:46 +05:30
|
|
|
config.include WaitHelpers, type: :feature
|
2018-10-15 14:42:47 +05:30
|
|
|
config.include EmailHelpers, :mailer, type: :mailer
|
|
|
|
config.include Warden::Test::Helpers, type: :request
|
|
|
|
config.include Gitlab::Routing, type: :routing
|
|
|
|
config.include Devise::Test::ControllerHelpers, type: :view
|
|
|
|
config.include ApiHelpers, :api
|
|
|
|
config.include CookieHelper, :js
|
|
|
|
config.include InputHelper, :js
|
|
|
|
config.include SelectionHelper, :js
|
|
|
|
config.include InspectRequests, :js
|
|
|
|
config.include WaitForRequests, :js
|
|
|
|
config.include LiveDebugger, :js
|
|
|
|
config.include MigrationsHelpers, :migration
|
|
|
|
config.include RedisHelpers
|
2018-11-08 19:23:39 +05:30
|
|
|
config.include Rails.application.routes.url_helpers, type: :routing
|
2019-07-07 11:18:12 +05:30
|
|
|
config.include PolicyHelpers, type: :policy
|
2019-09-30 21:07:59 +05:30
|
|
|
config.include MemoryUsageHelper
|
2019-10-12 21:52:04 +05:30
|
|
|
config.include ExpectRequestWithStatus, type: :request
|
2019-12-04 20:38:33 +05:30
|
|
|
config.include RailsHelpers
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
if ENV['CI']
|
|
|
|
# This includes the first try, i.e. tests will be run 4 times before failing.
|
|
|
|
config.default_retry_count = 4
|
|
|
|
config.reporter.register_listener(
|
|
|
|
RspecFlaky::Listener.new,
|
|
|
|
:example_passed,
|
|
|
|
:dump_summary)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2016-08-24 12:49:21 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
config.before(:suite) do
|
|
|
|
Timecop.safe_mode = true
|
|
|
|
TestEnv.init
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
config.after(:all) do
|
|
|
|
TestEnv.clean_test_path
|
|
|
|
end
|
|
|
|
|
2019-05-03 19:53:19 +05:30
|
|
|
config.before do |example|
|
2017-09-10 17:25:29 +05:30
|
|
|
# Enable all features by default for testing
|
|
|
|
allow(Feature).to receive(:enabled?) { true }
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-05-03 19:53:19 +05:30
|
|
|
enabled = example.metadata[:enable_rugged].present?
|
|
|
|
|
|
|
|
# Disable Rugged features by default
|
|
|
|
Gitlab::Git::RuggedImpl::Repository::FEATURE_FLAGS.each do |flag|
|
|
|
|
allow(Feature).to receive(:enabled?).with(flag).and_return(enabled)
|
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
allow(Gitlab::GitalyClient).to receive(:can_use_disk?).and_return(enabled)
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
# The following can be removed when we remove the staged rollout strategy
|
|
|
|
# and we can just enable it using instance wide settings
|
|
|
|
# (ie. ApplicationSetting#auto_devops_enabled)
|
|
|
|
allow(Feature).to receive(:enabled?)
|
|
|
|
.with(:force_autodevops_on_by_default, anything)
|
|
|
|
.and_return(false)
|
2019-09-30 21:07:59 +05:30
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
# Enable Marginalia feature for all specs in the test suite.
|
|
|
|
allow(Gitlab::Marginalia).to receive(:cached_feature_enabled?).and_return(true)
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
# The following can be removed once Vue Issuable Sidebar
|
|
|
|
# is feature-complete and can be made default in place
|
|
|
|
# of older sidebar.
|
|
|
|
# See https://gitlab.com/groups/gitlab-org/-/epics/1863
|
|
|
|
allow(Feature).to receive(:enabled?)
|
|
|
|
.with(:vue_issuable_sidebar, anything)
|
|
|
|
.and_return(false)
|
|
|
|
allow(Feature).to receive(:enabled?)
|
|
|
|
.with(:vue_issuable_epic_sidebar, anything)
|
|
|
|
.and_return(false)
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
# Stub these calls due to being expensive operations
|
|
|
|
# It can be reenabled for specific tests via:
|
|
|
|
#
|
|
|
|
# allow(DetectRepositoryLanguagesWorker).to receive(:perform_async).and_call_original
|
|
|
|
# allow(Gitlab::Git::KeepAround).to receive(:execute).and_call_original
|
|
|
|
allow(DetectRepositoryLanguagesWorker).to receive(:perform_async).and_return(true)
|
|
|
|
allow(Gitlab::Git::KeepAround).to receive(:execute)
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
Gitlab::ThreadMemoryCache.cache_backend.clear
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
# Temporary patch to force admin mode to be active by default in tests when
|
|
|
|
# using the feature flag :user_mode_in_session, since this will require
|
|
|
|
# modifying a significant number of specs to test both states for admin
|
|
|
|
# mode enabled / disabled.
|
|
|
|
#
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/issues/31511
|
|
|
|
# See gitlab/spec/support/helpers/admin_mode_helpers.rb
|
|
|
|
#
|
|
|
|
# If it is required to have the real behaviour that an admin is signed in
|
|
|
|
# with normal user mode and needs to switch to admin mode, it is possible to
|
|
|
|
# mark such tests with the `do_not_mock_admin_mode` metadata tag, e.g:
|
|
|
|
#
|
|
|
|
# context 'some test with normal user mode', :do_not_mock_admin_mode do ... end
|
|
|
|
unless example.metadata[:do_not_mock_admin_mode]
|
|
|
|
allow_any_instance_of(Gitlab::Auth::CurrentUserMode).to receive(:admin_mode?) do |current_user_mode|
|
|
|
|
current_user_mode.send(:user)&.admin?
|
|
|
|
end
|
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
2019-10-12 21:52:04 +05:30
|
|
|
config.around(:example, :quarantine) do |example|
|
2019-03-02 22:35:43 +05:30
|
|
|
# Skip tests in quarantine unless we explicitly focus on them.
|
2019-10-12 21:52:04 +05:30
|
|
|
example.run if config.inclusion_filter[:quarantine]
|
2019-03-02 22:35:43 +05:30
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
config.before(:example, :request_store) do
|
|
|
|
RequestStore.begin!
|
|
|
|
end
|
|
|
|
|
|
|
|
config.after(:example, :request_store) do
|
|
|
|
RequestStore.end!
|
|
|
|
RequestStore.clear!
|
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
config.after do
|
2018-11-08 19:23:39 +05:30
|
|
|
Fog.unmock! if Fog.mock?
|
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
config.after do
|
2018-11-20 20:47:30 +05:30
|
|
|
Gitlab::CurrentSettings.clear_in_memory_application_settings!
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
config.before(:example, :mailer) do
|
|
|
|
reset_delivered_emails!
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
config.before(:example, :prometheus) do
|
|
|
|
matching_files = File.join(::Prometheus::Client.configuration.multiprocess_files_dir, "*.db")
|
|
|
|
Dir[matching_files].map { |filename| File.delete(filename) if File.file?(filename) }
|
|
|
|
|
|
|
|
Gitlab::Metrics.reset_registry!
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
config.around(:each, :use_clean_rails_memory_store_caching) do |example|
|
2016-08-24 12:49:21 +05:30
|
|
|
caching_store = Rails.cache
|
2017-09-10 17:25:29 +05:30
|
|
|
Rails.cache = ActiveSupport::Cache::MemoryStore.new
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
example.run
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
Rails.cache = caching_store
|
|
|
|
end
|
2016-11-03 12:29:30 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
config.around(:each, :clean_gitlab_redis_cache) do |example|
|
2018-10-15 14:42:47 +05:30
|
|
|
redis_cache_cleanup!
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
example.run
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
redis_cache_cleanup!
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
config.around(:each, :clean_gitlab_redis_shared_state) do |example|
|
2018-10-15 14:42:47 +05:30
|
|
|
redis_shared_state_cleanup!
|
|
|
|
|
|
|
|
example.run
|
|
|
|
|
|
|
|
redis_shared_state_cleanup!
|
|
|
|
end
|
|
|
|
|
|
|
|
config.around(:each, :clean_gitlab_redis_queues) do |example|
|
|
|
|
redis_queues_cleanup!
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
example.run
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
redis_queues_cleanup!
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
config.around(:each, :use_clean_rails_memory_store_fragment_caching) do |example|
|
|
|
|
caching_store = ActionController::Base.cache_store
|
|
|
|
ActionController::Base.cache_store = ActiveSupport::Cache::MemoryStore.new
|
|
|
|
ActionController::Base.perform_caching = true
|
|
|
|
|
|
|
|
example.run
|
|
|
|
|
|
|
|
ActionController::Base.perform_caching = false
|
|
|
|
ActionController::Base.cache_store = caching_store
|
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
config.around(:each, :use_sql_query_cache) do |example|
|
|
|
|
ActiveRecord::Base.cache do
|
|
|
|
example.run
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
# The :each scope runs "inside" the example, so this hook ensures the DB is in the
|
|
|
|
# correct state before any examples' before hooks are called. This prevents a
|
|
|
|
# problem where `ScheduleIssuesClosedAtTypeChange` (or any migration that depends
|
|
|
|
# on background migrations being run inline during test setup) can be broken by
|
|
|
|
# altering Sidekiq behavior in an unrelated spec like so:
|
|
|
|
#
|
|
|
|
# around do |example|
|
|
|
|
# Sidekiq::Testing.fake! do
|
|
|
|
# example.run
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
config.before(:context, :migration) do
|
|
|
|
schema_migrate_down!
|
|
|
|
end
|
|
|
|
|
|
|
|
# Each example may call `migrate!`, so we must ensure we are migrated down every time
|
2017-09-10 17:25:29 +05:30
|
|
|
config.before(:each, :migration) do
|
2019-02-15 15:39:39 +05:30
|
|
|
use_fake_application_settings
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
schema_migrate_down!
|
|
|
|
end
|
|
|
|
|
|
|
|
config.after(:context, :migration) do
|
|
|
|
schema_migrate_up!
|
2019-02-15 15:39:39 +05:30
|
|
|
|
|
|
|
Gitlab::CurrentSettings.clear_in_memory_application_settings!
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
# This makes sure the `ApplicationController#can?` method is stubbed with the
|
|
|
|
# original implementation for all view specs.
|
|
|
|
config.before(:each, type: :view) do
|
|
|
|
allow(view).to receive(:can?) do |*args|
|
|
|
|
Ability.allowed?(*args)
|
|
|
|
end
|
|
|
|
end
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
config.before(:each, :http_pages_enabled) do |_|
|
|
|
|
allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80'])
|
|
|
|
end
|
|
|
|
|
|
|
|
config.before(:each, :https_pages_enabled) do |_|
|
|
|
|
allow(Gitlab.config.pages).to receive(:external_https).and_return(['1.1.1.1:443'])
|
|
|
|
end
|
|
|
|
|
|
|
|
config.before(:each, :http_pages_disabled) do |_|
|
|
|
|
allow(Gitlab.config.pages).to receive(:external_http).and_return(false)
|
|
|
|
end
|
|
|
|
|
|
|
|
config.before(:each, :https_pages_disabled) do |_|
|
|
|
|
allow(Gitlab.config.pages).to receive(:external_https).and_return(false)
|
|
|
|
end
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
# We can't use an `around` hook here because the wrapping transaction
|
|
|
|
# is not yet opened at the time that is triggered
|
|
|
|
config.prepend_before do
|
|
|
|
Gitlab::Database.set_open_transactions_baseline
|
|
|
|
end
|
|
|
|
|
|
|
|
config.append_after do
|
|
|
|
Gitlab::Database.reset_open_transactions_baseline
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
# add simpler way to match asset paths containing digest strings
|
|
|
|
RSpec::Matchers.define :match_asset_path do |expected|
|
|
|
|
match do |actual|
|
|
|
|
path = Regexp.escape(expected)
|
|
|
|
extname = Regexp.escape(File.extname(expected))
|
|
|
|
digest_regex = Regexp.new(path.sub(extname, "(?:-\\h+)?#{extname}") << '$')
|
|
|
|
digest_regex =~ actual
|
|
|
|
end
|
|
|
|
|
|
|
|
failure_message do |actual|
|
|
|
|
"expected that #{actual} would include an asset path for #{expected}"
|
|
|
|
end
|
|
|
|
|
|
|
|
failure_message_when_negated do |actual|
|
|
|
|
"expected that #{actual} would not include an asset path for #{expected}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
FactoryBot::SyntaxRunner.class_eval do
|
2015-10-24 18:46:33 +05:30
|
|
|
include RSpec::Mocks::ExampleMethods
|
|
|
|
end
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
# Use FactoryBot 4.x behavior:
|
|
|
|
# https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#associations
|
|
|
|
FactoryBot.use_parent_strategy = false
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
ActiveRecord::Migration.maintain_test_schema!
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
Shoulda::Matchers.configure do |config|
|
|
|
|
config.integrate do |with|
|
|
|
|
with.test_framework :rspec
|
|
|
|
with.library :rails
|
|
|
|
end
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
# Prevent Rugged from picking up local developer gitconfig.
|
|
|
|
Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
# Disable timestamp checks for invisible_captcha
|
|
|
|
InvisibleCaptcha.timestamp_enabled = false
|