Commit 4c0a7256 authored by Arturo Herrero's avatar Arturo Herrero

RSpec zero monkey patching mode

The plan for RSpec 4.0 is to disable monkey patching:
https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode

This commit stops using RSpec monkey patching:
https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
parent 9ed204a2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::DesignRepositorySyncWorker, :geo do RSpec.describe Geo::DesignRepositorySyncWorker, :geo do
describe '#perform' do describe '#perform' do
it 'runs DesignRepositorySyncService' do it 'runs DesignRepositorySyncService' do
project = create(:project) project = create(:project)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "spec_helper" require "spec_helper"
describe Geo::EventWorker, :geo do RSpec.describe Geo::EventWorker, :geo do
describe "#perform" do describe "#perform" do
it "calls Geo::EventService" do it "calls Geo::EventService" do
args = ["package_file", "created", { "model_record_id" => 1 }] args = ["package_file", "created", { "model_record_id" => 1 }]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::FileDownloadDispatchWorker, :geo, :geo_fdw, :use_sql_query_cache_for_tracking_db do RSpec.describe Geo::FileDownloadDispatchWorker, :geo, :geo_fdw, :use_sql_query_cache_for_tracking_db do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::FileDownloadWorker, :geo do RSpec.describe Geo::FileDownloadWorker, :geo do
describe '#perform' do describe '#perform' do
it 'instantiates and executes FileDownloadService' do it 'instantiates and executes FileDownloadService' do
service = double(:service) service = double(:service)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::MigratedLocalFilesCleanUpWorker, :geo, :geo_fdw, :use_sql_query_cache_for_tracking_db do RSpec.describe Geo::MigratedLocalFilesCleanUpWorker, :geo, :geo_fdw, :use_sql_query_cache_for_tracking_db do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::PruneEventLogWorker, :geo do RSpec.describe Geo::PruneEventLogWorker, :geo do
include ::EE::GeoHelpers include ::EE::GeoHelpers
subject(:worker) { described_class.new } subject(:worker) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoriesCleanUpWorker, :geo, :geo_fdw do RSpec.describe Geo::RepositoriesCleanUpWorker, :geo, :geo_fdw do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryCleanupWorker, :geo do RSpec.describe Geo::RepositoryCleanupWorker, :geo do
include ::EE::GeoHelpers include ::EE::GeoHelpers
describe '#perform' do describe '#perform' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryShardSyncWorker, :geo, :geo_fdw, :clean_gitlab_redis_cache, :use_sql_query_cache_for_tracking_db do RSpec.describe Geo::RepositoryShardSyncWorker, :geo, :geo_fdw, :clean_gitlab_redis_cache, :use_sql_query_cache_for_tracking_db do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositorySyncWorker, :geo, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositorySyncWorker, :geo, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
let!(:primary) { create(:geo_node, :primary) } let!(:primary) { create(:geo_node, :primary) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Primary::BatchWorker, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositoryVerification::Primary::BatchWorker, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
let_it_be(:healthy_not_verified) { create(:project) } let_it_be(:healthy_not_verified) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Primary::ShardWorker, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositoryVerification::Primary::ShardWorker, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Primary::SingleWorker, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositoryVerification::Primary::SingleWorker, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Secondary::SchedulerWorker, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositoryVerification::Secondary::SchedulerWorker, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
let_it_be(:healthy_not_verified) { create(:project) } let_it_be(:healthy_not_verified) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Secondary::ShardWorker, :geo, :geo_fdw, :request_store, :clean_gitlab_redis_cache, :use_sql_query_cache_for_tracking_db do RSpec.describe Geo::RepositoryVerification::Secondary::ShardWorker, :geo, :geo_fdw, :request_store, :clean_gitlab_redis_cache, :use_sql_query_cache_for_tracking_db do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RepositoryVerification::Secondary::SingleWorker, :clean_gitlab_redis_cache do RSpec.describe Geo::RepositoryVerification::Secondary::SingleWorker, :clean_gitlab_redis_cache do
include ::EE::GeoHelpers include ::EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::Scheduler::PerShardSchedulerWorker do RSpec.describe Geo::Scheduler::PerShardSchedulerWorker do
it 'includes ApplicationWorker' do it 'includes ApplicationWorker' do
expect(described_class).to include_module(ApplicationWorker) expect(described_class).to include_module(ApplicationWorker)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::Scheduler::SchedulerWorker, :geo do RSpec.describe Geo::Scheduler::SchedulerWorker, :geo do
subject { described_class.new } subject { described_class.new }
it 'includes ::Gitlab::Geo::LogHelpers' do it 'includes ::Gitlab::Geo::LogHelpers' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::Secondary::RegistryConsistencyWorker, :geo, :geo_fdw do RSpec.describe Geo::Secondary::RegistryConsistencyWorker, :geo, :geo_fdw do
include EE::GeoHelpers include EE::GeoHelpers
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::Secondary::RepositoryBackfillWorker, :geo, :geo_fdw, :clean_gitlab_redis_cache do RSpec.describe Geo::Secondary::RepositoryBackfillWorker, :geo, :geo_fdw, :clean_gitlab_redis_cache do
include EE::GeoHelpers include EE::GeoHelpers
let(:primary) { create(:geo_node, :primary) } let(:primary) { create(:geo_node, :primary) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::SidekiqCronConfigWorker do RSpec.describe Geo::SidekiqCronConfigWorker do
describe '#perform' do describe '#perform' do
it 'runs the cron manager' do it 'runs the cron manager' do
manager = double('cron_manager') manager = double('cron_manager')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GeoRepositoryDestroyWorker do RSpec.describe GeoRepositoryDestroyWorker do
describe '#perform' do describe '#perform' do
it 'delegates project removal to Geo::RepositoryDestroyService' do it 'delegates project removal to Geo::RepositoryDestroyService' do
project = create(:project) project = create(:project)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe HistoricalDataWorker do RSpec.describe HistoricalDataWorker do
subject { described_class.new } subject { described_class.new }
describe '#perform' do describe '#perform' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ImportSoftwareLicensesWorker do RSpec.describe ImportSoftwareLicensesWorker do
let(:catalogue) { build(:spdx_catalogue) } let(:catalogue) { build(:spdx_catalogue) }
let(:spdx_apache_license) { build(:spdx_license, :apache_1) } let(:spdx_apache_license) { build(:spdx_license, :apache_1) }
let(:spdx_bsd_license) { build(:spdx_license, :bsd) } let(:spdx_bsd_license) { build(:spdx_license, :bsd) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe JiraConnect::SyncBranchWorker do RSpec.describe JiraConnect::SyncBranchWorker do
describe '#perform' do describe '#perform' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:project_id) { project.id } let(:project_id) { project.id }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe JiraConnect::SyncMergeRequestWorker do RSpec.describe JiraConnect::SyncMergeRequestWorker do
describe '#perform' do describe '#perform' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
let(:merge_request_id) { merge_request.id } let(:merge_request_id) { merge_request.id }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe LdapAllGroupsSyncWorker do RSpec.describe LdapAllGroupsSyncWorker do
let(:subject) { described_class.new } let(:subject) { described_class.new }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe LdapGroupSyncWorker do RSpec.describe LdapGroupSyncWorker do
include LdapHelpers include LdapHelpers
let(:subject) { described_class.new } let(:subject) { described_class.new }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe LdapSyncWorker do RSpec.describe LdapSyncWorker do
let(:subject) { described_class.new } let(:subject) { described_class.new }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe NewEpicWorker do RSpec.describe NewEpicWorker do
describe '#perform' do describe '#perform' do
let(:worker) { described_class.new } let(:worker) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe PostReceive do RSpec.describe PostReceive do
let(:changes) { "123456 789012 refs/heads/tést\n654321 210987 refs/tags/tag" } let(:changes) { "123456 789012 refs/heads/tést\n654321 210987 refs/tags/tag" }
let(:changes_with_master) { "#{changes}\n423423 797823 refs/heads/master" } let(:changes_with_master) { "#{changes}\n423423 797823 refs/heads/master" }
let(:wrongly_encoded_changes) { changes.encode("ISO-8859-1").force_encoding("UTF-8") } let(:wrongly_encoded_changes) { changes.encode("ISO-8859-1").force_encoding("UTF-8") }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectCacheWorker do RSpec.describe ProjectCacheWorker do
let(:worker) { described_class.new } let(:worker) { described_class.new }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectImportScheduleWorker do RSpec.describe ProjectImportScheduleWorker do
describe '#perform' do describe '#perform' do
it 'does nothing if the database is read-only' do it 'does nothing if the database is read-only' do
project = create(:project) project = create(:project)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe PurgeDependencyProxyCacheWorker do RSpec.describe PurgeDependencyProxyCacheWorker do
let_it_be(:user) { create(:admin) } let_it_be(:user) { create(:admin) }
let_it_be(:blob) { create(:dependency_proxy_blob )} let_it_be(:blob) { create(:dependency_proxy_blob )}
let_it_be(:group) { blob.group } let_it_be(:group) { blob.group }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RefreshLicenseComplianceChecksWorker do RSpec.describe RefreshLicenseComplianceChecksWorker do
subject { described_class.new } subject { described_class.new }
describe '#perform' do describe '#perform' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RemoveUnreferencedLfsObjectsWorker do RSpec.describe RemoveUnreferencedLfsObjectsWorker do
include EE::GeoHelpers include EE::GeoHelpers
describe '#perform' do describe '#perform' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RepositoryImportWorker do RSpec.describe RepositoryImportWorker do
let(:project) { create(:project, :import_scheduled) } let(:project) { create(:project, :import_scheduled) }
it 'updates the error on custom project template Import/Export' do it 'updates the error on custom project template Import/Export' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RepositoryPushAuditEventWorker do RSpec.describe RepositoryPushAuditEventWorker do
describe '#perform' do describe '#perform' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RepositoryUpdateMirrorWorker do RSpec.describe RepositoryUpdateMirrorWorker do
describe '#perform' do describe '#perform' do
let(:jid) { '12345678' } let(:jid) { '12345678' }
let!(:project) { create(:project) } let!(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "spec_helper" require "spec_helper"
describe ServiceDeskEmailReceiverWorker, :mailer do RSpec.describe ServiceDeskEmailReceiverWorker, :mailer do
describe '#perform' do describe '#perform' do
let(:worker) { described_class.new } let(:worker) { described_class.new }
let(:email) { fixture_file('emails/service_desk_custom_address.eml', dir: 'ee') } let(:email) { fixture_file('emails/service_desk_custom_address.eml', dir: 'ee') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StatusPage::PublishWorker do RSpec.describe StatusPage::PublishWorker do
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StoreSecurityReportsWorker do RSpec.describe StoreSecurityReportsWorker do
describe '#perform' do describe '#perform' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, namespace: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StoreSecurityScansWorker do RSpec.describe StoreSecurityScansWorker do
describe '#perform' do describe '#perform' do
context 'build has security reports' do context 'build has security reports' do
let(:build) { create(:ci_build, :dast) } let(:build) { create(:ci_build, :dast) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SyncSeatLinkRequestWorker, type: :worker do RSpec.describe SyncSeatLinkRequestWorker, type: :worker do
describe '#perform' do describe '#perform' do
subject do subject do
described_class.new.perform('2020-01-01', '123', 5, 4) described_class.new.perform('2020-01-01', '123', 5, 4)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SyncSeatLinkWorker, type: :worker do RSpec.describe SyncSeatLinkWorker, type: :worker do
describe '#perform' do describe '#perform' do
context 'when current, paid license is active' do context 'when current, paid license is active' do
let(:utc_time) { Time.utc(2020, 3, 12, 12, 00) } let(:utc_time) { Time.utc(2020, 3, 12, 12, 00) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SyncSecurityReportsToReportApprovalRulesWorker do RSpec.describe SyncSecurityReportsToReportApprovalRulesWorker do
describe '#perform' do describe '#perform' do
let(:pipeline) { double(:pipeline, id: 42) } let(:pipeline) { double(:pipeline, id: 42) }
let(:sync_service) { double(:service, execute: true) } let(:sync_service) { double(:service, execute: true) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UpdateAllMirrorsWorker do RSpec.describe UpdateAllMirrorsWorker do
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
subject(:worker) { described_class.new } subject(:worker) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker do RSpec.describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker do
subject { described_class.new } subject { described_class.new }
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
load File.expand_path('../../bin/changelog', __dir__) load File.expand_path('../../bin/changelog', __dir__)
describe 'bin/changelog' do RSpec.describe 'bin/changelog' do
let(:options) { OpenStruct.new(title: 'Test title', type: 'fixed', dry_run: true) } let(:options) { OpenStruct.new(title: 'Test title', type: 'fixed', dry_run: true) }
describe ChangelogEntry do describe ChangelogEntry do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
require 'shellwords' require 'shellwords'
describe 'bin/sidekiq-cluster' do RSpec.describe 'bin/sidekiq-cluster' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
context 'when selecting some queues and excluding others' do context 'when selecting some queues and excluding others' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApplicationCable::Connection, :clean_gitlab_redis_shared_state do RSpec.describe ApplicationCable::Connection, :clean_gitlab_redis_shared_state do
let(:session_id) { Rack::Session::SessionId.new('6919a6f1bb119dd7396fadc38fd18d0d') } let(:session_id) { Rack::Session::SessionId.new('6919a6f1bb119dd7396fadc38fd18d0d') }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe IssuesChannel do RSpec.describe IssuesChannel do
let_it_be(:issue) { create(:issue) } let_it_be(:issue) { create(:issue) }
it 'rejects when project path is invalid' do it 'rejects when project path is invalid' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Application do # rubocop:disable RSpec/FilePath RSpec.describe Gitlab::Application do # rubocop:disable RSpec/FilePath
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
filtered_param = ActiveSupport::ParameterFilter::FILTERED filtered_param = ActiveSupport::ParameterFilter::FILTERED
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'mail_room.yml' do RSpec.describe 'mail_room.yml' do
include StubENV include StubENV
let(:mailroom_config_path) { 'config/mail_room.yml' } let(:mailroom_config_path) { 'config/mail_room.yml' }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
require Rails.root.join('config', 'object_store_settings.rb') require Rails.root.join('config', 'object_store_settings.rb')
describe ObjectStoreSettings do RSpec.describe ObjectStoreSettings do
describe '.parse' do describe '.parse' do
it 'sets correct default values' do it 'sets correct default values' do
settings = described_class.parse(nil) settings = described_class.parse(nil)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Settings do RSpec.describe Settings do
describe 'omniauth' do describe 'omniauth' do
it 'defaults to enabled' do it 'defaults to enabled' do
expect(described_class.omniauth.enabled).to be true expect(described_class.omniauth.enabled).to be true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SmimeSignatureSettings do RSpec.describe SmimeSignatureSettings do
describe '.parse' do describe '.parse' do
let(:default_smime_key) { Rails.root.join('.gitlab_smime_key') } let(:default_smime_key) { Rails.root.join('.gitlab_smime_key') }
let(:default_smime_cert) { Rails.root.join('.gitlab_smime_cert') } let(:default_smime_cert) { Rails.root.join('.gitlab_smime_cert') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AbuseReportsController do RSpec.describe AbuseReportsController do
let(:reporter) { create(:user) } let(:reporter) { create(:user) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:attrs) do let(:attrs) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AcmeChallengesController do RSpec.describe AcmeChallengesController do
describe '#show' do describe '#show' do
let!(:acme_order) { create(:pages_domain_acme_order) } let!(:acme_order) { create(:pages_domain_acme_order) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::AppearancesController do RSpec.describe Admin::AppearancesController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:header_message) { 'Header message' } let(:header_message) { 'Header message' }
let(:footer_message) { 'Footer' } let(:footer_message) { 'Footer' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ApplicationSettingsController do RSpec.describe Admin::ApplicationSettingsController do
include StubENV include StubENV
include UsageDataHelpers include UsageDataHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ApplicationsController do RSpec.describe Admin::ApplicationsController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:application) { create(:oauth_application, owner_id: nil, owner_type: nil) } let(:application) { create(:oauth_application, owner_id: nil, owner_type: nil) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::Ci::VariablesController do RSpec.describe Admin::Ci::VariablesController do
let_it_be(:variable) { create(:ci_instance_variable) } let_it_be(:variable) { create(:ci_instance_variable) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::Clusters::ApplicationsController do RSpec.describe Admin::Clusters::ApplicationsController do
include AccessMatchersForController include AccessMatchersForController
def current_application def current_application
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ClustersController do RSpec.describe Admin::ClustersController do
include AccessMatchersForController include AccessMatchersForController
include GoogleApi::CloudPlatformHelpers include GoogleApi::CloudPlatformHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::DashboardController do RSpec.describe Admin::DashboardController do
describe '#index' do describe '#index' do
context 'with pending_delete projects' do context 'with pending_delete projects' do
render_views render_views
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::GitalyServersController do RSpec.describe Admin::GitalyServersController do
describe '#index' do describe '#index' do
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::GroupsController do RSpec.describe Admin::GroupsController do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, namespace: group) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::HealthCheckController do RSpec.describe Admin::HealthCheckController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::HooksController do RSpec.describe Admin::HooksController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::IdentitiesController do RSpec.describe Admin::IdentitiesController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ImpersonationsController do RSpec.describe Admin::ImpersonationsController do
let(:impersonator) { create(:admin) } let(:impersonator) { create(:admin) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::IntegrationsController do RSpec.describe Admin::IntegrationsController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:integration) { create(:jira_service, :instance) } let(:integration) { create(:jira_service, :instance) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ProjectsController do RSpec.describe Admin::ProjectsController do
let!(:project) { create(:project, :public) } let!(:project) { create(:project, :public) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::RequestsProfilesController do RSpec.describe Admin::RequestsProfilesController do
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::RunnersController do RSpec.describe Admin::RunnersController do
let_it_be(:runner) { create(:ci_runner) } let_it_be(:runner) { create(:ci_runner) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::Serverless::DomainsController do RSpec.describe Admin::Serverless::DomainsController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::ServicesController do RSpec.describe Admin::ServicesController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::SessionsController, :do_not_mock_admin_mode do RSpec.describe Admin::SessionsController, :do_not_mock_admin_mode do
include_context 'custom session' include_context 'custom session'
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::SpamLogsController do RSpec.describe Admin::SpamLogsController do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:first_spam) { create(:spam_log, user: user) } let!(:first_spam) { create(:spam_log, user: user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::UsersController do RSpec.describe Admin::UsersController do
let(:user) { create(:user) } let(:user) { create(:user) }
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe ApplicationController do RSpec.describe ApplicationController do
include TermsHelper include TermsHelper
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AutocompleteController do RSpec.describe AutocompleteController do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.owner }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::IssuesController do RSpec.describe Boards::IssuesController do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
let(:project) { create(:project, :private) } let(:project) { create(:project, :private) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::ListsController do RSpec.describe Boards::ListsController do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ChaosController do RSpec.describe ChaosController do
describe '#leakmem' do describe '#leakmem' do
it 'calls synchronously' do it 'calls synchronously' do
expect(Gitlab::Chaos).to receive(:leak_mem).with(100, 30.seconds) expect(Gitlab::Chaos).to receive(:leak_mem).with(100, 30.seconds)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe BoardsResponses do RSpec.describe BoardsResponses do
let(:controller_class) do let(:controller_class) do
Class.new do Class.new do
include BoardsResponses include BoardsResponses
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ChecksCollaboration do RSpec.describe ChecksCollaboration do
include ProjectForksHelper include ProjectForksHelper
let(:helper) do let(:helper) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ConfirmEmailWarning do RSpec.describe ConfirmEmailWarning do
before do before do
stub_feature_flags(soft_email_confirmation: true) stub_feature_flags(soft_email_confirmation: true)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ContinueParams do RSpec.describe ContinueParams do
let(:controller_class) do let(:controller_class) do
Class.new(ActionController::Base) do Class.new(ActionController::Base) do
include ContinueParams include ContinueParams
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ControllerWithCrossProjectAccessCheck do RSpec.describe ControllerWithCrossProjectAccessCheck do
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EnforcesAdminAuthentication do RSpec.describe EnforcesAdminAuthentication do
include AdminModeHelper include AdminModeHelper
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GroupTree do RSpec.describe GroupTree do
let(:group) { create(:group, :public) } let(:group) { create(:group, :public) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ImportUrlParams do RSpec.describe ImportUrlParams do
let(:import_url_params) do let(:import_url_params) do
controller = OpenStruct.new(params: params).extend(described_class) controller = OpenStruct.new(params: params).extend(described_class)
controller.import_url_params controller.import_url_params
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe InternalRedirect do RSpec.describe InternalRedirect do
let(:controller_class) do let(:controller_class) do
Class.new do Class.new do
include InternalRedirect include InternalRedirect
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe IssuableActions do RSpec.describe IssuableActions do
let(:project) { double('project') } let(:project) { double('project') }
let(:user) { double('user') } let(:user) { double('user') }
let(:issuable) { double('issuable') } let(:issuable) { double('issuable') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe IssuableCollections do RSpec.describe IssuableCollections do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:controller) do let(:controller) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe LfsRequest do RSpec.describe LfsRequest do
include ProjectForksHelper include ProjectForksHelper
controller(Repositories::GitHttpClientController) do controller(Repositories::GitHttpClientController) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MetricsDashboard do RSpec.describe MetricsDashboard do
include MetricsDashboardHelpers include MetricsDashboardHelpers
describe 'GET #metrics_dashboard' do describe 'GET #metrics_dashboard' do
......
...@@ -14,7 +14,7 @@ class PageLimiterSpecController < ApplicationController ...@@ -14,7 +14,7 @@ class PageLimiterSpecController < ApplicationController
end end
end end
describe PageLimiter do RSpec.describe PageLimiter do
let(:controller_class) do let(:controller_class) do
PageLimiterSpecController PageLimiterSpecController
end end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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