Commit 9bd1e55b authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '220018-rspec-zero-monkey-patching-mode-5' into 'master'

[RUN AS-IF-FOSS] Enforce RSpec zero monkey patching mode

Closes #220018

See merge request gitlab-org/gitlab!35059
parents db6f6337 b38eb09a
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::FeatureFlagIssuesController do
RSpec.describe Projects::FeatureFlagIssuesController do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
let_it_be(:reporter) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Iterations list', :js do
RSpec.describe 'Iterations list', :js do
let(:now) { Time.now }
let_it_be(:group) { create(:group) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Merge Requests > User resets approvers', :js do
RSpec.describe 'Merge Requests > User resets approvers', :js do
include FeatureApprovalHelper
let(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Feature flag issue links', :js do
RSpec.describe 'Feature flag issue links', :js do
include FeatureFlagHelpers
let_it_be(:developer) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Pipelines::RunDastScan do
RSpec.describe Mutations::Pipelines::RunDastScan do
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::SecurityReportSummaryResolver do
RSpec.describe Resolvers::SecurityReportSummaryResolver do
include GraphqlHelpers
let_it_be(:pipeline) { double('project') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::Vulnerabilities::IssueLinksResolver do
RSpec.describe Resolvers::Vulnerabilities::IssueLinksResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Pipeline'] do
RSpec.describe GitlabSchema.types['Pipeline'] do
it { expect(described_class.graphql_name).to eq('Pipeline') }
it 'includes the ee specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['SecurityReportSummarySection'] do
RSpec.describe GitlabSchema.types['SecurityReportSummarySection'] do
specify { expect(described_class.graphql_name).to eq('SecurityReportSummarySection') }
it 'has specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['SecurityReportSummary'] do
RSpec.describe GitlabSchema.types['SecurityReportSummary'] do
specify { expect(described_class.graphql_name).to eq('SecurityReportSummary') }
it 'has specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityIssueLinkType'] do
RSpec.describe GitlabSchema.types['VulnerabilityIssueLinkType'] do
let(:expected_values) { %w[RELATED CREATED] }
subject { described_class.values.keys }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityIssueLink'] do
RSpec.describe GitlabSchema.types['VulnerabilityIssueLink'] do
let(:expected_fields) { %i[id link_type issue] }
subject { described_class }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityLocationSecretDetection'] do
RSpec.describe GitlabSchema.types['VulnerabilityLocationSecretDetection'] do
it do
expect(described_class).to have_graphql_fields(
:end_line,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Admin::MergeRequestApprovalSettingsHelper do
RSpec.describe Admin::MergeRequestApprovalSettingsHelper do
describe '#show_compliance_merge_request_approval_settings?' do
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::ApplicationSettingsHelper do
RSpec.describe EE::ApplicationSettingsHelper do
describe '.visible_attributes' do
context 'personal access token parameters' do
it { expect(visible_attributes).to include(*%i(max_personal_access_token_lifetime enforce_pat_expiration)) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::SubscribableBannerHelper do
RSpec.describe EE::SubscribableBannerHelper do
describe '#gitlab_subscription_or_license' do
subject { helper.gitlab_subscription_or_license }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Alerting::NotificationPayloadParser do
RSpec.describe Gitlab::Alerting::NotificationPayloadParser do
let(:project) { build_stubbed(:project) }
describe '.call' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixRubyObjectInAuditEvents, :migration, schema: 20200518114540 do
RSpec.describe Gitlab::BackgroundMigration::FixRubyObjectInAuditEvents, :migration, schema: 20200518114540 do
let(:audit_events) { table(:audit_events) }
it 'cleans up ruby/object in details field', :aggregate_failures do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::UpdateVulnerabilitiesFromDismissalFeedback, :migration, schema: 20200519201128 do
RSpec.describe Gitlab::BackgroundMigration::UpdateVulnerabilitiesFromDismissalFeedback, :migration, schema: 20200519201128 do
let(:users) { table(:users) }
let(:projects) { table(:projects) }
let(:vulnerabilities) { table(:vulnerabilities) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::IssuableMetadata do
RSpec.describe Gitlab::IssuableMetadata do
let_it_be(:user) { create(:user) }
let_it_be(:project1) { create(:project, :public, :repository, creator: user, namespace: user.namespace) }
let_it_be(:project2) { create(:project, :public, :repository, creator: user, namespace: user.namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Secret do
RSpec.describe Gitlab::Ci::Config::Entry::Secret do
let(:entry) { described_class.new(config) }
describe 'validation' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Secrets do
RSpec.describe Gitlab::Ci::Config::Entry::Secrets do
let(:entry) { described_class.new(config) }
describe 'validation' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Vault::Engine do
RSpec.describe Gitlab::Ci::Config::Entry::Vault::Engine do
let(:entry) { described_class.new(config) }
describe 'validation' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Vault::Secret do
RSpec.describe Gitlab::Ci::Config::Entry::Vault::Secret do
let(:entry) { described_class.new(config) }
describe 'validation' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Geo::RegistryBatcher, :geo, :use_clean_rails_memory_store_caching do
RSpec.describe Gitlab::Geo::RegistryBatcher, :geo, :use_clean_rails_memory_store_caching do
describe '#next_range!' do
let(:model_class) { LfsObject }
let(:model_foreign_key) { registry_class::MODEL_FOREIGN_KEY }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::UsageDataCounters::IngressModsecurityCounter, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::UsageDataCounters::IngressModsecurityCounter, :clean_gitlab_redis_shared_state do
describe '.add' do
it 'increases packets_processed and packets_anomalous counters and sets statistics_unavailable counter' do
described_class.add(3, 10_200, 2_500)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StatusPage::UsageDataCounters::IncidentCounter do
RSpec.describe StatusPage::UsageDataCounters::IncidentCounter do
it_behaves_like 'a redis usage counter', 'StatusPage::IncidentCounter', :publishes
it_behaves_like 'a redis usage counter', 'StatusPage::IncidentCounter', :unpublishes
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200519201128_migrate_vulnerability_dismissal_feedback.rb')
describe MigrateVulnerabilityDismissalFeedback, :migration, :sidekiq do
RSpec.describe MigrateVulnerabilityDismissalFeedback, :migration, :sidekiq do
let(:users) { table(:users) }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200518114540_schedule_fix_ruby_object_in_audit_events.rb')
describe ScheduleFixRubyObjectInAuditEvents do
RSpec.describe ScheduleFixRubyObjectInAuditEvents do
let(:audit_events) { table(:audit_events) }
it 'schedules background migrations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BoardUserPreference do
RSpec.describe BoardUserPreference do
before do
create(:board_user_preference)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectSecuritySetting do
RSpec.describe ProjectSecuritySetting do
describe 'associations' do
subject { create(:project_security_setting) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::Packages::Composer::PackagesPresenter do
RSpec.describe ::Packages::Composer::PackagesPresenter do
using RSpec::Parameterized::TableSyntax
let_it_be(:package_name) { 'sample-project' }
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe API::Commits do
RSpec.describe API::Commits do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository, creator: user, path: "my.project") }
let(:project_id) { project.id }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Running a DAST Scan' do
RSpec.describe 'Running a DAST Scan' do
include GraphqlHelpers
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'getting a compliance frameworks list for a project' do
RSpec.describe 'getting a compliance frameworks list for a project' do
include GraphqlHelpers
let_it_be(:project_member) { create(:project_member, :maintainer) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::API::ResourceWeightEvents do
RSpec.describe ::API::ResourceWeightEvents do
let_it_be(:user) { create(:user) }
let_it_be(:project, reload: true) { create(:project, :public, namespace: user.namespace) }
let_it_be(:issue) { create(:issue, project: project, author: user) }
......
......@@ -12,7 +12,7 @@ require 'spec_helper'
# - maintainer
# because they are 3 edge cases of using wiki pages.
describe API::Wikis do
RSpec.describe API::Wikis do
include WorkhorseHelpers
let_it_be(:user) { create(:user) }
......
......@@ -51,7 +51,7 @@ RSpec.describe Projects::Analytics::CodeReviewsController, type: :request do
end
end
describe Projects::Analytics::CodeReviewsController, type: :controller do
RSpec.describe Projects::Analytics::CodeReviewsController, type: :controller do
let(:user) { create :user }
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Evidences::ReleaseEntity do
RSpec.describe Evidences::ReleaseEntity do
let(:project) { create(:project, :repository) }
let(:release) { build(:release, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Evidences::BuildArtifactEntity do
RSpec.describe Evidences::BuildArtifactEntity do
include Gitlab::Routing
let(:build) { create(:ci_build, :artifacts) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Evidences::EvidenceEntity do
RSpec.describe Evidences::EvidenceEntity do
let(:project) { create(:project, :repository) }
let(:release) { create(:release, project: project) }
let(:evidence) { build(:evidence, release: release) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::CompareLicenseScanningReportsService do
RSpec.describe Ci::CompareLicenseScanningReportsService do
let_it_be(:project) { create(:project, :repository) }
let(:service) { described_class.new(project, nil) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::CompareSecurityReportsService do
RSpec.describe Ci::CompareSecurityReportsService do
let_it_be(:project) { create(:project, :repository) }
let(:current_user) { build(:user, :admin) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::PipelineBridgeStatusService do
RSpec.describe Ci::PipelineBridgeStatusService do
let_it_be(:project) { create(:project) }
let(:user) { build(:user) }
let(:pipeline) { build(:ci_pipeline, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::RunDastScanService do
RSpec.describe Ci::RunDastScanService do
let(:project) { create(:project) }
let(:branch) { SecureRandom.hex }
let(:target_url) { FFaker::Internet.uri(:http) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::AllowedEmailDomains::UpdateService do
RSpec.describe EE::AllowedEmailDomains::UpdateService do
let(:group) { create(:group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::Integrations::Test::ProjectService do
RSpec.describe ::Integrations::Test::ProjectService do
let(:user) { double('user') }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Releases::CreateEvidenceService do
RSpec.describe Releases::CreateEvidenceService do
include Gitlab::Routing
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Security::IngressModsecurityUsageService do
RSpec.describe EE::Security::IngressModsecurityUsageService do
describe '#execute' do
let(:environment) { create(:environment) }
let(:ingress_mode) { :modsecurity_blocking }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::ProcessInitialBookkeepingService do
RSpec.describe Elastic::ProcessInitialBookkeepingService do
let(:project) { create(:project) }
let(:issue) { create(:issue) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ReplicationToggleRequestService, :geo do
RSpec.describe Geo::ReplicationToggleRequestService, :geo do
include ::EE::GeoHelpers
include ApiHelpers
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Composer::ComposerJsonService do
RSpec.describe Packages::Composer::ComposerJsonService do
describe '#execute' do
let(:branch) { project.repository.find_branch('master') }
let(:target) { branch.target }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Composer::CreatePackageService do
RSpec.describe Packages::Composer::CreatePackageService do
include EE::PackagesManagerApiSpecHelpers
let_it_be(:package_name) { 'composer-package-name' }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Composer::VersionParserService do
RSpec.describe Packages::Composer::VersionParserService do
let_it_be(:params) { {} }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::Alerting::NotifyService do
RSpec.describe Projects::Alerting::NotifyService do
let_it_be(:project, refind: true) { create(:project) }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RequirementsManagement::ProcessTestReportsService do
RSpec.describe RequirementsManagement::ProcessTestReportsService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:build) { create(:ee_ci_build, :requirements_report, project: project, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::Configuration::SaveAutoFixService do
RSpec.describe Security::Configuration::SaveAutoFixService do
describe '#execute' do
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::ReportSummaryService, '#execute' do
RSpec.describe Security::ReportSummaryService, '#execute' do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:pipeline) { create(:ci_pipeline, :success, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::ScannedResourcesCountingService, '#execute' do
RSpec.describe Security::ScannedResourcesCountingService, '#execute' do
before do
stub_licensed_features(sast: true, dependency_scanning: true, container_scanning: true, dast: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::VulnerabilityCountingService, '#execute' do
RSpec.describe Security::VulnerabilityCountingService, '#execute' do
before do
stub_licensed_features(sast: true, dependency_scanning: true, container_scanning: true, dast: true)
end
......
# frozen_string_literal: true
shared_examples 'a Geo framework registry' do
RSpec.shared_examples 'a Geo framework registry' do
let(:registry_class_factory) { described_class.underscore.tr('/', '_').to_sym }
context 'finders' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'layouts/header/_new_dropdown' do
RSpec.describe 'layouts/header/_new_dropdown' do
let(:user) { create(:user) }
context 'group-specific links' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RegistrySyncWorker, :geo, :use_sql_query_cache_for_tracking_db do
RSpec.describe Geo::RegistrySyncWorker, :geo, :use_sql_query_cache_for_tracking_db do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IngressModsecurityCounterMetricsWorker, :clean_gitlab_redis_shared_state do
RSpec.describe IngressModsecurityCounterMetricsWorker, :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers
subject(:worker) { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RequirementsManagement::ProcessRequirementsReportsWorker do
RSpec.describe RequirementsManagement::ProcessRequirementsReportsWorker do
describe '#perform' do
context 'build exists' do
let(:build) { create(:ci_build) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::ImportsController do
RSpec.describe Groups::ImportsController do
describe 'GET #show' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group, :private) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::Pipelines::TestsController do
RSpec.describe Projects::Pipelines::TestsController do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Registrations::ExperienceLevelsController do
RSpec.describe Registrations::ExperienceLevelsController do
let_it_be(:namespace) { create(:group, path: 'group-path' ) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Import/Export - Group Import', :js do
RSpec.describe 'Import/Export - Group Import', :js do
let_it_be(:user) { create(:user) }
let_it_be(:import_path) { "#{Dir.tmpdir}/group_import_spec" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Projects > Activity > User sees design Activity', :js do
RSpec.describe 'Projects > Activity > User sees design Activity', :js do
include DesignManagementTestHelpers
let_it_be(:uploader) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::AlertManagement::Alerts::SetAssignees do
RSpec.describe Mutations::AlertManagement::Alerts::SetAssignees do
let_it_be(:starting_assignee) { create(:user) }
let_it_be(:unassigned_user) { create(:user) }
let_it_be(:alert) { create(:alert_management_alert, assignees: [starting_assignee]) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::ContainerExpirationPolicies::Update do
RSpec.describe Mutations::ContainerExpirationPolicies::Update do
using RSpec::Parameterized::TableSyntax
let_it_be(:project, reload: true) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LooksAhead do
RSpec.describe LooksAhead do
include GraphqlHelpers
let_it_be(:the_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::ProjectMembersResolver do
RSpec.describe Resolvers::ProjectMembersResolver do
include GraphqlHelpers
context "with a group" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::ProjectPipelineResolver do
RSpec.describe Resolvers::ProjectPipelineResolver do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::UsersResolver do
RSpec.describe Resolvers::UsersResolver do
include GraphqlHelpers
let_it_be(:user1) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['AccessLevelEnum'] do
RSpec.describe GitlabSchema.types['AccessLevelEnum'] do
specify { expect(described_class.graphql_name).to eq('AccessLevelEnum') }
it 'exposes all the existing access levels' do
......
# frozen_string_literal: true
require 'spec_helper'
describe GitlabSchema.types['AccessLevel'] do
RSpec.describe GitlabSchema.types['AccessLevel'] do
specify { expect(described_class.graphql_name).to eq('AccessLevel') }
specify { expect(described_class).to require_graphql_authorizations(nil) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['ReleaseEvidence'] do
RSpec.describe GitlabSchema.types['ReleaseEvidence'] do
it { expect(described_class).to require_graphql_authorizations(:download_code) }
it 'has the expected fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::GroupMemberType do
RSpec.describe Types::GroupMemberType do
specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Group) }
specify { expect(described_class.graphql_name).to eq('GroupMember') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['MilestoneStats'] do
RSpec.describe GitlabSchema.types['MilestoneStats'] do
it { expect(described_class).to require_graphql_authorizations(:read_milestone) }
it 'has the expected fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::ProjectMemberType do
RSpec.describe Types::ProjectMemberType do
specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Project) }
specify { expect(described_class.graphql_name).to eq('ProjectMember') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['ReleaseAssetLink'] do
RSpec.describe GitlabSchema.types['ReleaseAssetLink'] do
it { expect(described_class).to require_graphql_authorizations(:read_release) }
it 'has the expected fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::Snippets::FileInputActionEnum do
RSpec.describe Types::Snippets::FileInputActionEnum do
specify { expect(described_class.graphql_name).to eq('SnippetFileInputActionEnum') }
it 'exposes all file input action types' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::Snippets::FileInputType do
RSpec.describe Types::Snippets::FileInputType do
specify { expect(described_class.graphql_name).to eq('SnippetFileInputType') }
it 'has the correct arguments' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['UntrustedRegexp'] do
RSpec.describe GitlabSchema.types['UntrustedRegexp'] do
using RSpec::Parameterized::TableSyntax
specify { expect(described_class.graphql_name).to eq('UntrustedRegexp') }
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe Analytics::UniqueVisitsHelper do
RSpec.describe Analytics::UniqueVisitsHelper do
include Devise::Test::ControllerHelpers
describe '#track_visit' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SubscribableBannerHelper do
RSpec.describe SubscribableBannerHelper do
describe '#display_subscription_banner!' do
it 'is over-written in EE' do
expect { helper.display_subscription_banner! }.not_to raise_error
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Entities::DeployKey do
RSpec.describe API::Entities::DeployKey do
describe '#as_json' do
subject { entity.as_json }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Entities::DeployKeysProject do
RSpec.describe API::Entities::DeployKeysProject do
describe '#as_json' do
subject { entity.as_json }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Entities::SSHKey do
RSpec.describe API::Entities::SSHKey do
describe '#as_json' do
subject { entity.as_json }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Validations::Validators::UntrustedRegexp do
RSpec.describe API::Validations::Validators::UntrustedRegexp do
include ApiValidatorsHelpers
subject do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::JiraImport::AdfToCommonmarkFilter do
RSpec.describe Banzai::Filter::JiraImport::AdfToCommonmarkFilter do
include FilterSpecHelper
let_it_be(:fixtures_path) { 'lib/kramdown/atlassian_document_format' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Pipeline::JiraImport::AdfCommonmarkPipeline do
RSpec.describe Banzai::Pipeline::JiraImport::AdfCommonmarkPipeline do
let_it_be(:fixtures_path) { 'lib/kramdown/atlassian_document_format' }
it 'converts text in Atlassian Document Format ' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ExtractsRef do
RSpec.describe ExtractsRef do
include described_class
include RepoHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::UniqueVisits, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::Analytics::UniqueVisits, :clean_gitlab_redis_shared_state do
let(:unique_visits) { Gitlab::Analytics::UniqueVisits.new }
let(:target1_id) { 'g_analytics_contribution' }
let(:target2_id) { 'g_analytics_insights' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Build::Releaser do
RSpec.describe Gitlab::Ci::Build::Releaser do
subject { described_class.new(config: config[:release]).script }
describe '#script' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Reports::TestReportSummary do
RSpec.describe Gitlab::Ci::Reports::TestReportSummary do
let(:build_report_result_1) { build(:ci_build_report_result) }
let(:build_report_result_2) { build(:ci_build_report_result, :with_junit_success) }
let(:test_report_summary) { described_class.new([build_report_result_1, build_report_result_2]) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Reports::TestSuiteSummary do
RSpec.describe Gitlab::Ci::Reports::TestSuiteSummary do
let(:build_report_result_1) { build(:ci_build_report_result) }
let(:build_report_result_2) { build(:ci_build_report_result, :with_junit_success) }
let(:test_suite_summary) { described_class.new([build_report_result_1, build_report_result_2]) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::DataBuilder::Alert do
RSpec.describe Gitlab::DataBuilder::Alert do
let_it_be(:project) { create(:project) }
let_it_be(:alert) { create(:alert_management_alert, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Database::CustomStructure do
RSpec.describe Gitlab::Database::CustomStructure do
let_it_be(:structure) { described_class.new }
let_it_be(:filepath) { Rails.root.join(described_class::CUSTOM_DUMP_FILE) }
let_it_be(:file_header) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Database::DynamicModelHelpers do
RSpec.describe Gitlab::Database::DynamicModelHelpers do
describe '#define_batchable_model' do
subject { including_class.new.define_batchable_model(table_name) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Database::Migrations::BackgroundMigrationHelpers do
RSpec.describe Gitlab::Database::Migrations::BackgroundMigrationHelpers do
let(:model) do
ActiveRecord::Migration.new.extend(described_class)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable, '#perform' do
RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable, '#perform' do
subject { described_class.new }
let(:source_table) { '_test_partitioning_backfills' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::DependencyLinker::GoModLinker do
RSpec.describe Gitlab::DependencyLinker::GoModLinker do
let(:file_name) { 'go.mod' }
let(:file_content) do
<<-CONTENT.strip_heredoc
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::DependencyLinker::GoSumLinker do
RSpec.describe Gitlab::DependencyLinker::GoSumLinker do
let(:file_name) { 'go.sum' }
let(:file_content) do
<<-CONTENT.strip_heredoc
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Diff::StatsCache, :use_clean_rails_memory_store_caching do
RSpec.describe Gitlab::Diff::StatsCache, :use_clean_rails_memory_store_caching do
subject(:stats_cache) { described_class.new(cachable_key: cachable_key) }
let(:key) { ['diff_stats', cachable_key, described_class::VERSION].join(":") }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Doctor::Secrets do
RSpec.describe Gitlab::Doctor::Secrets do
let!(:user) { create(:user, otp_secret: "test") }
let!(:group) { create(:group, runners_token: "test") }
let(:logger) { double(:logger).as_null_object }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Emoji do
RSpec.describe Gitlab::Emoji do
let_it_be(:emojis) { Gemojione.index.instance_variable_get(:@emoji_by_name) }
let_it_be(:emojis_by_moji) { Gemojione.index.instance_variable_get(:@emoji_by_moji) }
let_it_be(:emoji_unicode_versions_by_name) { Gitlab::Json.parse(File.read(Rails.root.join('fixtures', 'emojis', 'emoji-unicode-version-map.json'))) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::GitAccessProject do
RSpec.describe Gitlab::GitAccessProject do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let(:actor) { user }
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Graphql::MountMutation do
RSpec.describe Gitlab::Graphql::MountMutation do
let_it_be(:mutation) do
Class.new(Mutations::BaseMutation) do
graphql_name 'TestMutation'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Instrumentation::RedisBase, :request_store do
RSpec.describe Gitlab::Instrumentation::RedisBase, :request_store do
let(:instrumentation_class_a) do
stub_const('InstanceA', Class.new(described_class))
end
......
......@@ -4,7 +4,7 @@ require 'fast_spec_helper'
require 'support/helpers/rails_helpers'
require 'rspec-parameterized'
describe Gitlab::Instrumentation::RedisClusterValidator do
RSpec.describe Gitlab::Instrumentation::RedisClusterValidator do
include RailsHelpers
describe '.validate!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Metrics::Dashboard::Stages::UrlValidator do
RSpec.describe Gitlab::Metrics::Dashboard::Stages::UrlValidator do
let(:project) { build_stubbed(:project) }
describe '#transform!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Metrics::Dashboard::Stages::VariableEndpointInserter do
RSpec.describe Gitlab::Metrics::Dashboard::Stages::VariableEndpointInserter do
include MetricsDashboardHelpers
let(:project) { build_stubbed(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Suggestions::CommitMessage do
RSpec.describe Gitlab::Suggestions::CommitMessage do
def create_suggestion(file_path, new_line, to_content)
position = Gitlab::Diff::Position.new(old_path: file_path,
new_path: file_path,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Suggestions::FileSuggestion do
RSpec.describe Gitlab::Suggestions::FileSuggestion do
def create_suggestion(new_line, to_content, lines_above = 0, lines_below = 0)
position = Gitlab::Diff::Position.new(old_path: file_path,
new_path: file_path,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Suggestions::SuggestionSet do
RSpec.describe Gitlab::Suggestions::SuggestionSet do
def create_suggestion(file_path, new_line, to_content)
position = Gitlab::Diff::Position.new(old_path: file_path,
new_path: file_path,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::UsageDataConcerns::Topology do
RSpec.describe Gitlab::UsageDataConcerns::Topology do
include UsageDataHelpers
describe '#topology_usage_data' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
context Kramdown::Parser::AtlassianDocumentFormat do
RSpec.context Kramdown::Parser::AtlassianDocumentFormat do
let_it_be(:options) { { input: 'AtlassianDocumentFormat', html_tables: true } }
let_it_be(:fixtures_path) { 'lib/kramdown/atlassian_document_format' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LearnGitlab do
RSpec.describe LearnGitlab do
let_it_be(:current_user) { create(:user) }
let_it_be(:learn_gitlab_project) { create(:project, name: LearnGitlab::PROJECT_NAME) }
let_it_be(:learn_gitlab_board) { create(:board, project: learn_gitlab_project, name: LearnGitlab::BOARD_NAME) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200526231421_update_index_approval_rule_name_for_code_owners_rule_type.rb')
describe UpdateIndexApprovalRuleNameForCodeOwnersRuleType do
RSpec.describe UpdateIndexApprovalRuleNameForCodeOwnersRuleType do
let(:migration) { described_class.new }
let(:approval_rules) { table(:approval_merge_request_rules) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200609212701_add_incident_settings_to_all_existing_projects.rb')
describe AddIncidentSettingsToAllExistingProjects, :migration do
RSpec.describe AddIncidentSettingsToAllExistingProjects, :migration do
let(:project_incident_management_settings) { table(:project_incident_management_settings) }
let(:labels) { table(:labels) }
let(:label_links) { table(:label_links) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200608072931_backfill_imported_snippet_repositories.rb')
describe BackfillImportedSnippetRepositories do
RSpec.describe BackfillImportedSnippetRepositories do
let(:users) { table(:users) }
let(:snippets) { table(:snippets) }
let(:user) { users.create(id: 1, email: 'user@example.com', projects_limit: 10, username: 'test', name: 'Test', state: 'active') }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200602013901_cap_designs_filename_length_to_new_limit')
describe CapDesignsFilenameLengthToNewLimit, :migration, schema: 20200528125905 do
RSpec.describe CapDesignsFilenameLengthToNewLimit, :migration, schema: 20200528125905 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:issues) { table(:issues) }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200602143020_update_routes_for_lost_and_found_group_and_orphaned_projects.rb')
describe UpdateRoutesForLostAndFoundGroupAndOrphanedProjects, :migration do
RSpec.describe UpdateRoutesForLostAndFoundGroupAndOrphanedProjects, :migration do
let(:users) { table(:users) }
let(:namespaces) { table(:namespaces) }
let(:members) { table(:members) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AlertManagement::AlertUserMention do
RSpec.describe AlertManagement::AlertUserMention do
describe 'associations' do
it { is_expected.to belong_to(:alert_management_alert) }
it { is_expected.to belong_to(:note) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlobViewer::GoMod do
RSpec.describe BlobViewer::GoMod do
include FakeBlobHelpers
let(:project) { build_stubbed(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupDeployKey do
RSpec.describe GroupDeployKey do
it { is_expected.to validate_presence_of(:user) }
it 'is of type DeployKey' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupImportState do
RSpec.describe GroupImportState do
describe 'validations' do
let_it_be(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ChatMessage::AlertMessage do
RSpec.describe ChatMessage::AlertMessage do
subject { described_class.new(args) }
let_it_be(:start_time) { Time.current }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SnippetStatistics do
RSpec.describe SnippetStatistics do
let_it_be(:snippet_without_repo) { create(:snippet) }
let_it_be(:snippet_with_repo) { create(:snippet, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BlamePresenter do
RSpec.describe Gitlab::BlamePresenter do
let(:project) { create(:project, :repository) }
let(:path) { 'files/ruby/popen.rb' }
let(:commit) { project.commit('master') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Setting assignees of an alert' do
RSpec.describe 'Setting assignees of an alert' do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Updating the container expiration policy' do
RSpec.describe 'Updating the container expiration policy' do
include GraphqlHelpers
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Importing Jira Users' do
RSpec.describe 'Importing Jira Users' do
include JiraServiceHelper
include GraphqlHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Metrics::Dashboard::Annotations::Delete do
RSpec.describe Mutations::Metrics::Dashboard::Annotations::Delete do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'getting Alert Management Alert Assignees' do
RSpec.describe 'getting Alert Management Alert Assignees' do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'getting Alert Management Alert Notes' do
RSpec.describe 'getting Alert Management Alert Notes' do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'getting pipeline information nested in a project' do
RSpec.describe 'getting pipeline information nested in a project' do
include GraphqlHelpers
let(:project) { create(:project, :repository, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Query.project(fullPath).releases()' do
RSpec.describe 'Query.project(fullPath).releases()' do
include GraphqlHelpers
let_it_be(:stranger) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'GroupMember' do
RSpec.describe 'GroupMember' do
include GraphqlHelpers
let_it_be(:member) { create(:group_member, :developer) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'ProjectMember' do
RSpec.describe 'ProjectMember' do
include GraphqlHelpers
let_it_be(:member) { create(:project_member, :developer) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Users' do
RSpec.describe 'Users' do
include GraphqlHelpers
let_it_be(:current_user) { create(:user, created_at: 1.day.ago) }
......
......@@ -373,7 +373,7 @@ RSpec.describe AutocompleteController, 'routing' do
end
end
describe Snippets::BlobsController, "routing" do
RSpec.describe Snippets::BlobsController, "routing" do
it "to #raw" do
expect(get('/-/snippets/1/raw/master/lib/version.rb'))
.to route_to('snippets/blobs#raw', snippet_id: '1', ref: 'master', path: 'lib/version.rb')
......
......@@ -5,7 +5,7 @@ require 'rubocop'
require 'rubocop/rspec/support'
require_relative '../../../rubocop/cop/default_scope'
describe RuboCop::Cop::DefaultScope, type: :rubocop do
RSpec.describe RuboCop::Cop::DefaultScope, type: :rubocop do
include CopHelper
subject(:cop) { described_class.new }
......
......@@ -5,7 +5,7 @@ require 'rubocop'
require 'rubocop/rspec/support'
require_relative '../../../../rubocop/cop/gitlab/bulk_insert'
describe RuboCop::Cop::Gitlab::BulkInsert, type: :rubocop do
RSpec.describe RuboCop::Cop::Gitlab::BulkInsert, type: :rubocop do
include CopHelper
subject(:cop) { described_class.new }
......
......@@ -7,7 +7,7 @@ require 'rubocop/rspec/support'
require_relative '../../../../rubocop/cop/migration/drop_table'
describe RuboCop::Cop::Migration::DropTable do
RSpec.describe RuboCop::Cop::Migration::DropTable do
include CopHelper
subject(:cop) { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::DailyBuildGroupReportResultEntity do
RSpec.describe Ci::DailyBuildGroupReportResultEntity do
let(:report_result) { double(date: '2020-05-20', group_name: 'rspec', data: { 'coverage' => 79.1 }) }
let(:entity) { described_class.new(report_result, param_type: param_type) }
let(:param_type) { 'coverage' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::DailyBuildGroupReportResultSerializer do
RSpec.describe Ci::DailyBuildGroupReportResultSerializer do
let(:report_result) do
[
double(date: '2020-05-20', group_name: 'rspec', data: { 'coverage' => 79.1 }),
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::BitbucketProviderRepoEntity do
RSpec.describe Import::BitbucketProviderRepoEntity do
let(:repo_data) do
{
'name' => 'repo_name',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::BitbucketServerProviderRepoEntity do
RSpec.describe Import::BitbucketServerProviderRepoEntity do
let(:repo_data) do
{
'name' => 'test',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::FogbugzProviderRepoEntity do
RSpec.describe Import::FogbugzProviderRepoEntity do
let(:provider_url) { 'https://demo.fogbugz.com/' }
let(:repo_data) do
{
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::GithubishProviderRepoEntity do
RSpec.describe Import::GithubishProviderRepoEntity do
let(:provider_url) { 'https://github.com/' }
let(:repo) do
{
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::GitlabProviderRepoEntity do
RSpec.describe Import::GitlabProviderRepoEntity do
let(:repo_data) do
{
'id' => 1,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Import::ProviderRepoSerializer do
RSpec.describe Import::ProviderRepoSerializer do
using RSpec::Parameterized::TableSyntax
describe '#represent' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AlertManagement::Alerts::UpdateService do
RSpec.describe AlertManagement::Alerts::UpdateService do
let_it_be(:user_with_permissions) { create(:user) }
let_it_be(:other_user_with_permissions) { create(:user) }
let_it_be(:user_without_permissions) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::PeriodicRecalculateService do
RSpec.describe AuthorizedProjectUpdate::PeriodicRecalculateService do
subject(:service) { described_class.new }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::ProjectGroupLinkCreateService do
RSpec.describe AuthorizedProjectUpdate::ProjectGroupLinkCreateService do
let_it_be(:group_parent) { create(:group, :private) }
let_it_be(:group) { create(:group, :private, parent: group_parent) }
let_it_be(:group_child) { create(:group, :private, parent: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::RecalculateForUserRangeService do
RSpec.describe AuthorizedProjectUpdate::RecalculateForUserRangeService do
describe '#execute' do
let_it_be(:users) { create_list(:user, 2) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::CreatePipelineService do
RSpec.describe Ci::CreatePipelineService do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:admin) }
let(:service) { described_class.new(project, user, { ref: 'refs/heads/master' }) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ContainerExpirationPolicies::UpdateService do
RSpec.describe ContainerExpirationPolicies::UpdateService do
using RSpec::Parameterized::TableSyntax
let_it_be(:project, reload: true) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GpgKeys::DestroyService do
RSpec.describe GpgKeys::DestroyService do
let(:user) { create(:user) }
subject { described_class.new(user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Integrations::Test::ProjectService do
RSpec.describe Integrations::Test::ProjectService do
let(:user) { double('user') }
describe '#execute' do
......
......@@ -331,6 +331,8 @@ RSpec.configure do |config|
Ability.allowed?(*args)
end
end
config.disable_monkey_patching!
end
ActiveRecord::Migration.maintain_test_schema!
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ArrayMembersValidator do
RSpec.describe ArrayMembersValidator do
using RSpec::Parameterized::TableSyntax
child_class = Class.new
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'projects/issues/import_csv/_button' do
RSpec.describe 'projects/issues/import_csv/_button' do
include Devise::Test::ControllerHelpers
context 'when the user does not have edit permissions' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::PeriodicRecalculateWorker do
RSpec.describe AuthorizedProjectUpdate::PeriodicRecalculateWorker do
describe '#perform' do
it 'calls AuthorizedProjectUpdate::PeriodicRecalculateService' do
expect_next_instance_of(AuthorizedProjectUpdate::PeriodicRecalculateService) do |service|
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::ProjectGroupLinkCreateWorker do
RSpec.describe AuthorizedProjectUpdate::ProjectGroupLinkCreateWorker do
let_it_be(:group) { create(:group, :private) }
let_it_be(:group_project) { create(:project, group: group) }
let_it_be(:shared_with_group) { create(:group, :private) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker do
RSpec.describe AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker do
let(:start_user_id) { 42 }
let(:end_user_id) { 4242 }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Import::StuckProjectImportJobsWorker do
RSpec.describe Gitlab::Import::StuckProjectImportJobsWorker do
let(:worker) { described_class.new }
describe 'with scheduled import_status' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IrkerWorker, '#perform' do
RSpec.describe IrkerWorker, '#perform' do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let_it_be(:push_data) { HashWithIndifferentAccess.new(Gitlab::DataBuilder::Push.build_sample(project, user)) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Metrics::Dashboard::PruneOldAnnotationsWorker do
RSpec.describe Metrics::Dashboard::PruneOldAnnotationsWorker do
let_it_be(:now) { DateTime.parse('2020-06-02T00:12:00Z') }
let_it_be(:two_weeks_old_annotation) { create(:metrics_dashboard_annotation, starting_at: now.advance(weeks: -2)) }
let_it_be(:one_day_old_annotation) { create(:metrics_dashboard_annotation, starting_at: now.advance(days: -1)) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RemoveExpiredGroupLinksWorker do
RSpec.describe RemoveExpiredGroupLinksWorker do
describe '#perform' do
context 'ProjectGroupLinks' do
let!(:expired_project_group_link) { create(:project_group_link, expires_at: 1.hour.ago) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RemoveExpiredMembersWorker do
RSpec.describe RemoveExpiredMembersWorker do
let(:worker) { described_class.new }
describe '#perform' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RemoveUnreferencedLfsObjectsWorker do
RSpec.describe RemoveUnreferencedLfsObjectsWorker do
let(:worker) { described_class.new }
describe '#perform' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryCheck::BatchWorker do
RSpec.describe RepositoryCheck::BatchWorker do
let(:shard_name) { 'default' }
subject { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryCheck::ClearWorker do
RSpec.describe RepositoryCheck::ClearWorker do
it 'clears repository check columns' do
project = create(:project)
project.update_columns(
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryCheck::DispatchWorker do
RSpec.describe RepositoryCheck::DispatchWorker do
subject { described_class.new }
it 'does nothing when repository checks are disabled' do
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require 'fileutils'
describe RepositoryCheck::SingleRepositoryWorker do
RSpec.describe RepositoryCheck::SingleRepositoryWorker do
subject(:worker) { described_class.new }
it 'skips when the project has no push events' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryCleanupWorker do
RSpec.describe RepositoryCleanupWorker do
let(:project) { create(:project) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryForkWorker do
RSpec.describe RepositoryForkWorker do
include ProjectForksHelper
describe 'modules' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryImportWorker do
RSpec.describe RepositoryImportWorker do
describe 'modules' do
it 'includes ProjectImportOptions' do
expect(described_class).to include_module(ProjectImportOptions)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryRemoveRemoteWorker do
RSpec.describe RepositoryRemoveRemoteWorker do
include ExclusiveLeaseHelpers
include GitHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_state do
RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_state do
subject { described_class.new }
let(:remote_mirror) { create(:remote_mirror) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RunPipelineScheduleWorker do
RSpec.describe RunPipelineScheduleWorker do
describe '#perform' do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ScheduleMigrateExternalDiffsWorker do
RSpec.describe ScheduleMigrateExternalDiffsWorker do
include ExclusiveLeaseHelpers
let(:worker) { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SelfMonitoringProjectCreateWorker do
RSpec.describe SelfMonitoringProjectCreateWorker do
describe '#perform' do
let(:service_class) { Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService }
let(:service) { instance_double(service_class) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SelfMonitoringProjectDeleteWorker do
RSpec.describe SelfMonitoringProjectDeleteWorker do
let_it_be(:jid) { 'b5b28910d97563e58c2fe55f' }
let_it_be(:data_key) { "self_monitoring_delete_result:#{jid}" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StageUpdateWorker do
RSpec.describe StageUpdateWorker do
describe '#perform' do
context 'when stage exists' do
let(:stage) { create(:ci_stage_entity) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StuckCiJobsWorker do
RSpec.describe StuckCiJobsWorker do
include ExclusiveLeaseHelpers
let!(:runner) { create :ci_runner }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StuckExportJobsWorker do
RSpec.describe StuckExportJobsWorker do
let(:worker) { described_class.new }
shared_examples 'project export job detection' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StuckImportJobsWorker do
RSpec.describe StuckImportJobsWorker do
let(:worker) { described_class.new }
describe 'with scheduled import_status' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StuckMergeJobsWorker do
RSpec.describe StuckMergeJobsWorker do
describe 'perform' do
let(:worker) { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SystemHookPushWorker do
RSpec.describe SystemHookPushWorker do
include RepoHelpers
subject { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TodosDestroyer::ConfidentialIssueWorker do
RSpec.describe TodosDestroyer::ConfidentialIssueWorker do
let(:service) { double }
it "calls the Todos::Destroy::ConfidentialIssueService with issue_id parameter" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TodosDestroyer::EntityLeaveWorker do
RSpec.describe TodosDestroyer::EntityLeaveWorker do
it "calls the Todos::Destroy::EntityLeaveService with the params it was given" do
service = double
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TodosDestroyer::GroupPrivateWorker do
RSpec.describe TodosDestroyer::GroupPrivateWorker do
it "calls the Todos::Destroy::GroupPrivateService with the params it was given" do
service = double
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TodosDestroyer::PrivateFeaturesWorker do
RSpec.describe TodosDestroyer::PrivateFeaturesWorker do
it "calls the Todos::Destroy::PrivateFeaturesService with the params it was given" do
service = double
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TodosDestroyer::ProjectPrivateWorker do
RSpec.describe TodosDestroyer::ProjectPrivateWorker do
it "calls the Todos::Destroy::ProjectPrivateService with the params it was given" do
service = double
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TrendingProjectsWorker do
RSpec.describe TrendingProjectsWorker do
describe '#perform' do
it 'refreshes the trending projects' do
expect(TrendingProject).to receive(:refresh!)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UpdateExternalPullRequestsWorker do
RSpec.describe UpdateExternalPullRequestsWorker do
describe '#perform' do
let_it_be(:project) { create(:project, import_source: 'tanuki/repository') }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UpdateHeadPipelineForMergeRequestWorker do
RSpec.describe UpdateHeadPipelineForMergeRequestWorker do
describe '#perform' do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UpdateHighestRoleWorker, :clean_gitlab_redis_shared_state do
RSpec.describe UpdateHighestRoleWorker, :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers
let(:worker) { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UpdateMergeRequestsWorker do
RSpec.describe UpdateMergeRequestsWorker do
include RepoHelpers
let(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UpdateProjectStatisticsWorker do
RSpec.describe UpdateProjectStatisticsWorker do
let(:worker) { described_class.new }
let(:project) { create(:project, :repository) }
let(:statistics) { %w(repository_size) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UploadChecksumWorker do
RSpec.describe UploadChecksumWorker do
describe '#perform' do
subject { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Users::CreateStatisticsWorker do
RSpec.describe Users::CreateStatisticsWorker do
describe '#perform' do
subject { described_class.new.perform }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe WaitForClusterCreationWorker do
RSpec.describe WaitForClusterCreationWorker do
describe '#perform' do
context 'when provider type is gcp' do
let(:cluster) { create(:cluster, provider_type: :gcp, provider_gcp: provider) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe X509CertificateRevokeWorker do
RSpec.describe X509CertificateRevokeWorker do
describe '#perform' do
context 'with a revoked certificate' do
subject { described_class.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe X509IssuerCrlCheckWorker do
RSpec.describe X509IssuerCrlCheckWorker do
subject(:worker) { described_class.new }
let(:project) { create(:project, :public, :repository) }
......
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