diff options
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 68beef40c0b..11a83bd9501 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,7 @@ require 'rspec/retry' require 'rspec-parameterized' require 'shoulda/matchers' require 'test_prof/recipes/rspec/let_it_be' +require 'test_prof/factory_default' rspec_profiling_is_configured = ENV['RSPEC_PROFILING_POSTGRES_URL'].present? || @@ -46,10 +47,10 @@ require_relative('../ee/spec/spec_helper') if Gitlab.ee? require Rails.root.join("spec/support/helpers/git_helpers.rb") # Then the rest -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 } -Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } +Dir[Rails.root.join("spec/support/helpers/*.rb")].sort.each { |f| require f } +Dir[Rails.root.join("spec/support/shared_contexts/*.rb")].sort.each { |f| require f } +Dir[Rails.root.join("spec/support/shared_examples/*.rb")].sort.each { |f| require f } +Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f } quality_level = Quality::TestLevel.new @@ -99,6 +100,10 @@ RSpec.configure do |config| metadata[:enable_admin_mode] = true if location =~ %r{(ee)?/spec/controllers/admin/} end + config.define_derived_metadata(file_path: %r{(ee)?/spec/.+_docs\.rb\z}) do |metadata| + metadata[:type] = :feature + end + config.include LicenseHelpers config.include ActiveJob::TestHelper config.include ActiveSupport::Testing::TimeHelpers @@ -110,6 +115,8 @@ RSpec.configure do |config| config.include StubExperiments config.include StubGitlabCalls config.include StubGitlabData + config.include SnowplowHelpers + config.include NextFoundInstanceOf config.include NextInstanceOf config.include TestEnv config.include Devise::Test::ControllerHelpers, type: :controller @@ -193,6 +200,14 @@ RSpec.configure do |config| stub_feature_flags(vue_issuable_sidebar: false) stub_feature_flags(vue_issuable_epic_sidebar: false) + # The following can be removed once we are confident the + # unified diff lines works as expected + stub_feature_flags(unified_diff_lines: false) + + # Merge request widget GraphQL requests are disabled in the tests + # for now whilst we migrate as much as we can over the GraphQL + stub_feature_flags(merge_request_widget_graphql: false) + enable_rugged = example.metadata[:enable_rugged].present? # Disable Rugged features by default @@ -261,6 +276,7 @@ RSpec.configure do |config| ./spec/support/protected_tags ./spec/support/shared_examples/features ./spec/support/shared_examples/requests + ./spec/support/shared_examples/lib/gitlab ./spec/views ./spec/workers ) @@ -359,3 +375,6 @@ Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s # Disable timestamp checks for invisible_captcha InvisibleCaptcha.timestamp_enabled = false + +# Initialize FactoryDefault to use create_default helper +TestProf::FactoryDefault.init |