Commit 767c5bb7 authored by Nick Thomas's avatar Nick Thomas

Merge branch '6420-unify-spec_helper.rb' into 'master'

Resolve "Extract EE specific files/lines for spec/spec_helper.rb"

Closes #6420

See merge request gitlab-org/gitlab-ee!6140
parents 3b4e7a4d 3fee9c44
Dir[Rails.root.join("ee/spec/support/helpers/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_contexts/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_examples/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.include EE::LicenseHelpers
config.before(:all) do
License.destroy_all
TestLicense.init
end
config.around(:each, :geo) do |example|
example.run if Gitlab::Database.postgresql?
end
config.around(:each, :geo_tracking_db) do |example|
example.run if Gitlab::Geo.geo_database_configured?
end
end
......@@ -30,12 +30,7 @@ end
# require rainbow gem String monkeypatch, so we can test SystemChecks
require 'rainbow/ext/string'
# EE specific support START
Dir[Rails.root.join("ee/spec/support/helpers/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_contexts/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_examples/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/**/*.rb")].each { |f| require f }
# EE specific support END
require_relative '../ee/spec/spec_helper'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
......@@ -94,11 +89,7 @@ RSpec.configure do |config|
config.include LiveDebugger, :js
config.include MigrationsHelpers, :migration
config.include RedisHelpers
# EE only START
config.include EE::LicenseHelpers
config.include Rails.application.routes.url_helpers, type: :routing
# EE only END
if ENV['CI']
# This includes the first try, i.e. tests will be run 4 times before failing.
......@@ -114,13 +105,6 @@ RSpec.configure do |config|
TestEnv.init
end
# EE-specific start
config.before(:all) do
License.destroy_all
TestLicense.init
end
# EE-specific stop
config.after(:all) do
TestEnv.clean_test_path
end
......@@ -215,14 +199,6 @@ RSpec.configure do |config|
example.run if Group.supports_nested_groups?
end
config.around(:each, :geo) do |example|
example.run if Gitlab::Database.postgresql?
end
config.around(:each, :geo_tracking_db) do |example|
example.run if Gitlab::Geo.geo_database_configured?
end
config.around(:each, :postgresql) do |example|
example.run if Gitlab::Database.postgresql?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment