Commit 94247ca4 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 @@
require 'spec_helper'
describe API::Helpers::Packages::DependencyProxyHelpers do
RSpec.describe API::Helpers::Packages::DependencyProxyHelpers do
let_it_be(:helper) { Class.new.include(described_class).new }
describe 'redirect_registry_request' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Helpers::PackagesHelpers do
RSpec.describe API::Helpers::PackagesHelpers do
let_it_be(:helper) { Class.new.include(described_class).new }
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Helpers::PackagesManagerClientsHelpers do
RSpec.describe API::Helpers::PackagesManagerClientsHelpers do
let_it_be(:personal_access_token) { create(:personal_access_token) }
let_it_be(:username) { personal_access_token.user.username }
let_it_be(:helper) { Class.new.include(described_class).new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Atlassian::JiraConnect::Client do
RSpec.describe Atlassian::JiraConnect::Client do
include StubRequests
subject { described_class.new('https://gitlab-test.atlassian.net', 'sample_secret') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Atlassian::JiraConnect::Serializers::AuthorEntity do
RSpec.describe Atlassian::JiraConnect::Serializers::AuthorEntity do
subject { described_class.represent(user).as_json }
context 'when object is a User model' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Atlassian::JiraConnect::Serializers::BranchEntity do
RSpec.describe Atlassian::JiraConnect::Serializers::BranchEntity do
let(:project) { create(:project, :repository) }
let(:branch) { project.repository.find_branch('improve/awesome') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Atlassian::JiraConnect::Serializers::RepositoryEntity do
RSpec.describe Atlassian::JiraConnect::Serializers::RepositoryEntity do
subject do
project = create(:project, :repository)
commits = [project.commit]
......
......@@ -2,7 +2,7 @@
require 'fast_spec_helper'
describe Atlassian::JiraIssueKeyExtractor do
RSpec.describe Atlassian::JiraIssueKeyExtractor do
describe '.has_keys?' do
subject { described_class.has_keys?(string) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Audit::Changes do
RSpec.describe Audit::Changes do
subject(:foo_instance) { Class.new { include Audit::Changes }.new }
describe '.audit_changes' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Audit::Details do
RSpec.describe Audit::Details do
let(:user) { create(:user) }
describe '.humanize' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::CrossProjectIssuableInformationFilter do
RSpec.describe Banzai::Filter::CrossProjectIssuableInformationFilter do
include ActionView::Helpers::UrlHelper
include FilterSpecHelper
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::EpicReferenceFilter do
RSpec.describe Banzai::Filter::EpicReferenceFilter do
include FilterSpecHelper
let(:urls) { Gitlab::Routing.url_helpers }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::InlineAlertMetricsFilter do
RSpec.describe Banzai::Filter::InlineAlertMetricsFilter do
include FilterSpecHelper
let(:params) { ['foo', 'bar', 12] }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::InlineClusterMetricsFilter do
RSpec.describe Banzai::Filter::InlineClusterMetricsFilter do
include FilterSpecHelper
let!(:cluster) { create(:cluster) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::InlineMetricsRedactorFilter do
RSpec.describe Banzai::Filter::InlineMetricsRedactorFilter do
include FilterSpecHelper
let_it_be(:project) { create(:project) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Banzai::Filter::IssuableStateFilter do
RSpec.describe Banzai::Filter::IssuableStateFilter do
include ActionView::Helpers::UrlHelper
include FilterSpecHelper
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::IterationReferenceFilter do
RSpec.describe Banzai::Filter::IterationReferenceFilter do
include FilterSpecHelper
let(:parent_group) { create(:group, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::Filter::LabelReferenceFilter do
RSpec.describe Banzai::Filter::LabelReferenceFilter do
include FilterSpecHelper
let(:project) { create(:project, :public, name: 'sample-project') }
......
# frozen_string_literal: true
require 'spec_helper'
describe Banzai::IssuableExtractor do
RSpec.describe Banzai::IssuableExtractor do
it 'returns an instance of an epic for the node with reference' do
epic = create(:epic)
user = create(:user)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::ReferenceParser::EpicParser do
RSpec.describe Banzai::ReferenceParser::EpicParser do
include ReferenceParserHelpers
def link(epic_id)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Banzai::ReferenceParser::IterationParser do
RSpec.describe Banzai::ReferenceParser::IterationParser do
include ReferenceParserHelpers
let(:project) { create(:project, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Constraints::JiraEncodedUrlConstrainer do
RSpec.describe Constraints::JiraEncodedUrlConstrainer do
let(:namespace_id) { 'group' }
let(:project_id) { 'project' }
let(:path) { "/#{namespace_id}/#{project_id}" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ContainerRegistry::Client do
RSpec.describe ContainerRegistry::Client do
let(:token) { '12345' }
let(:options) { { token: token } }
let(:client) { described_class.new("http://registry", options) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::Analytics::CodeReview::MergeRequest do
RSpec.describe EE::API::Entities::Analytics::CodeReview::MergeRequest do
subject(:entity_representation) { described_class.new(merge_request).as_json }
let(:merge_request) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::Analytics::GroupActivity do
RSpec.describe EE::API::Entities::Analytics::GroupActivity do
let(:count) { 10 }
shared_examples 'exposes count' do |count_type, entity|
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::GeoNodeStatus do
RSpec.describe EE::API::Entities::GeoNodeStatus do
include ::EE::GeoHelpers
let(:geo_node_status) { build(:geo_node_status) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Entities::Member do
RSpec.describe API::Entities::Member do
subject(:entity_representation) { described_class.new(member).as_json }
let(:member) { build_stubbed(:group_member) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::Nuget::Metadatum do
RSpec.describe EE::API::Entities::Nuget::Metadatum do
let(:metadatum) do
{
project_url: 'http://sandbox.com/project',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::Nuget::PackageMetadataCatalogEntry do
RSpec.describe EE::API::Entities::Nuget::PackageMetadataCatalogEntry do
let(:entry) do
{
json_url: 'http://sandbox.com/json/package',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Entities::Nuget::SearchResult do
RSpec.describe EE::API::Entities::Nuget::SearchResult do
let(:search_result) do
{
type: 'Package',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::Conflict do
RSpec.describe ::EE::API::Entities::Scim::Conflict do
let(:params) { { detail: 'error' } }
let(:entity) do
described_class.new(params)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::Emails do
RSpec.describe ::EE::API::Entities::Scim::Emails do
let(:user) { build(:user) }
let(:identity) { build(:group_saml_identity, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::Error do
RSpec.describe ::EE::API::Entities::Scim::Error do
let(:params) { { detail: 'error' } }
let(:entity) do
described_class.new(params)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::NotFound do
RSpec.describe ::EE::API::Entities::Scim::NotFound do
let(:entity) do
described_class.new({})
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::UserName do
RSpec.describe ::EE::API::Entities::Scim::UserName do
let(:user) { build(:user) }
subject { described_class.new(user).as_json }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::User do
RSpec.describe ::EE::API::Entities::Scim::User do
let(:user) { build(:user) }
let(:identity) { build(:group_saml_identity, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Scim::Users do
RSpec.describe ::EE::API::Entities::Scim::Users do
let(:user) { build(:user) }
let(:identity) { build(:group_saml_identity, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::VulnerabilityExport do
RSpec.describe ::EE::API::Entities::VulnerabilityExport do
let(:vulnerability_export) { create(:vulnerability_export, :finished, :csv, :with_csv_file) }
let(:entity) { described_class.new(vulnerability_export) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Entities::Vulnerability do
RSpec.describe ::EE::API::Entities::Vulnerability do
let_it_be(:project) { create(:project, :with_vulnerability) }
let(:vulnerability) { project.vulnerabilities.first }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe API::Helpers::IssuesHelpers do
RSpec.describe API::Helpers::IssuesHelpers do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:user) { create(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe EE::API::Helpers::MembersHelpers do
RSpec.describe EE::API::Helpers::MembersHelpers do
subject(:members_helpers) { Class.new.include(described_class).new }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'NotesHelpers' do
RSpec.describe 'NotesHelpers' do
describe '#find_noteable' do
let!(:group) { create(:group, :public) }
let!(:other_group) { create(:group, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Helpers::Runner do
RSpec.describe EE::API::Helpers::Runner do
let(:helper) { Class.new { include API::Helpers::Runner }.new }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::API::Helpers::ScimPagination do
RSpec.describe ::EE::API::Helpers::ScimPagination do
let(:query) { {} }
let(:pagination_class) { Struct.new(:params).include(described_class) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::API::Helpers do
RSpec.describe EE::API::Helpers do
include Rack::Test::Methods
let(:helper) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Audit::GroupChangesAuditor do
RSpec.describe EE::Audit::GroupChangesAuditor do
describe '.audit_changes' do
let!(:user) { create(:user) }
let!(:group) { create(:group, visibility_level: 0) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Audit::ProjectChangesAuditor do
RSpec.describe EE::Audit::ProjectChangesAuditor do
describe '.audit_changes' do
let(:user) { create(:user) }
let(:project) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Audit::ProjectFeatureChangesAuditor do
RSpec.describe EE::Audit::ProjectFeatureChangesAuditor do
describe '#execute' do
let!(:user) { create(:user) }
let!(:project) { create(:project, :pages_enabled, visibility_level: 0) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EventFilter do
RSpec.describe EventFilter do
describe '#apply_filter' do
let_it_be(:group) { create(:group, :public) }
let_it_be(:project) { create(:project, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Feature do
RSpec.describe Feature do
include EE::GeoHelpers
describe '.enable' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::BaseQueryBuilder do
RSpec.describe Gitlab::Analytics::CycleAnalytics::BaseQueryBuilder do
let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:project_in_group) { create(:project, :repository, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ApplicationContext do
RSpec.describe Gitlab::ApplicationContext do
describe '#to_lazy_hash' do
let(:user) { build(:user) }
let(:project) { build(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::AccessLevels do
RSpec.describe EE::Gitlab::Auth::Ldap::AccessLevels do
describe '#set' do
let(:access_levels) { described_class.new }
let(:dns) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::Group do
RSpec.describe EE::Gitlab::Auth::Ldap::Group do
include LdapHelpers
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::Sync::AdminUsers do
RSpec.describe EE::Gitlab::Auth::Ldap::Sync::AdminUsers do
include LdapHelpers
let(:adapter) { ldap_adapter }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::Sync::ExternalUsers do
RSpec.describe EE::Gitlab::Auth::Ldap::Sync::ExternalUsers do
include LdapHelpers
describe '#update_permissions' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::Sync::Group do
RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
include LdapHelpers
let(:adapter) { ldap_adapter }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Auth::Ldap::Sync::Groups do
RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Groups do
include LdapHelpers
let(:adapter) { ldap_adapter }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require 'net/ldap/dn'
describe EE::Gitlab::Auth::Ldap::Sync::Proxy do
RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Proxy do
include LdapHelpers
let(:adapter) { ldap_adapter }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::BackfillVersionDataFromGitaly do
RSpec.describe Gitlab::BackgroundMigration::BackfillVersionDataFromGitaly do
let(:issue) { create(:issue) }
def perform_worker
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRulesCheckProgress do
RSpec.describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRulesCheckProgress do
context 'when there is MigrateApproverToApprovalRulesInBatch jobs' do
it 'reschedules check' do
allow(Gitlab::BackgroundMigration).to receive(:exists?).with('MigrateApproverToApprovalRulesInBatch').and_return(true)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRulesInBatch do
RSpec.describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRulesInBatch do
context 'when there is no more MigrateApproverToApprovalRules jobs' do
let(:job) { double(:job) }
let(:project) { create(:project) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRules do
RSpec.describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRules do
def create_skip_sync(*args)
build(*args) do |record|
allow(record).to receive(:schedule_approval_migration)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
# rubocop: disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::MigrateSecurityScans, schema: 20200220180944 do
RSpec.describe Gitlab::BackgroundMigration::MigrateSecurityScans, schema: 20200220180944 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:builds) { table(:ci_builds) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MoveEpicIssuesAfterEpics, schema: 20190926180443 do
RSpec.describe Gitlab::BackgroundMigration::MoveEpicIssuesAfterEpics, schema: 20190926180443 do
let(:users) { table(:users) }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForMergeRequests, schema: 2019_09_05_091831 do
RSpec.describe Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForMergeRequests, schema: 2019_09_05_091831 do
let(:namespaces) { table(:namespaces) }
let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') }
let(:projects) { table(:projects) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForProjects, schema: 2019_09_05_091812 do
RSpec.describe Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForProjects, schema: 2019_09_05_091812 do
let(:namespaces) { table(:namespaces) }
let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') }
let(:projects) { table(:projects) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PruneOrphanedGeoEvents, geo: false, schema: 2020_01_02_170221 do
RSpec.describe Gitlab::BackgroundMigration::PruneOrphanedGeoEvents, geo: false, schema: 2020_01_02_170221 do
let(:event_table_name) { 'geo_repository_updated_events' }
let(:geo_event_log) { table(:geo_event_log) }
let(:geo_updated_events) { table(event_table_name) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceConfidenceLevel, :migration, schema: 20200506085748 do
RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceConfidenceLevel, :migration, schema: 20200506085748 do
let(:vulnerabilities) { table(:vulnerability_occurrences) }
let(:identifiers) { table(:vulnerability_identifiers) }
let(:scanners) { table(:vulnerability_scanners) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceSeverityLevel, schema: 20200227140242 do
RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedOccurrenceSeverityLevel, schema: 20200227140242 do
let(:vulnerabilities) { table(:vulnerability_occurrences) }
let(:identifiers) { table(:vulnerability_identifiers) }
let(:scanners) { table(:vulnerability_scanners) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RemoveUndefinedVulnerabilityConfidenceLevel, :migration, schema: 20200511092714 do
RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedVulnerabilityConfidenceLevel, :migration, schema: 20200511092714 do
let(:vulnerabilities) { table(:vulnerabilities) }
let(:identifiers) { table(:vulnerability_identifiers) }
let(:projects) { table(:projects) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RemoveUndefinedVulnerabilitySeverityLevel, :migration, schema: 20200302142052 do
RSpec.describe Gitlab::BackgroundMigration::RemoveUndefinedVulnerabilitySeverityLevel, :migration, schema: 20200302142052 do
let(:vulnerabilities) { table(:vulnerabilities) }
let(:identifiers) { table(:vulnerability_identifiers) }
let(:projects) { table(:projects) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::UpdateVulnerabilitiesToDismissed, :migration, schema: 20200416111111 do
RSpec.describe Gitlab::BackgroundMigration::UpdateVulnerabilitiesToDismissed, :migration, schema: 20200416111111 do
let(:users) { table(:users) }
let(:projects) { table(:projects) }
let(:vulnerabilities) { table(:vulnerabilities) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::UpdateVulnerabilityConfidence, schema: 20190909141517 do
RSpec.describe Gitlab::BackgroundMigration::UpdateVulnerabilityConfidence, schema: 20190909141517 do
let(:vulnerabilities) { table(:vulnerability_occurrences) }
let(:identifiers) { table(:vulnerability_identifiers) }
let(:scanners) { table(:vulnerability_scanners) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Checks::PushRuleCheck do
RSpec.describe EE::Gitlab::Checks::PushRuleCheck do
include_context 'push rules checks context'
let(:push_rule) { create(:push_rule, :commit_message) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Checks::PushRules::BranchCheck do
RSpec.describe EE::Gitlab::Checks::PushRules::BranchCheck do
include_context 'push rules checks context'
describe '#validate!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Checks::PushRules::CommitCheck do
RSpec.describe EE::Gitlab::Checks::PushRules::CommitCheck do
include_context 'push rules checks context'
describe '#validate!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Checks::PushRules::FileSizeCheck do
RSpec.describe EE::Gitlab::Checks::PushRules::FileSizeCheck do
include_context 'push rules checks context'
describe '#validate!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Checks::PushRules::TagCheck do
RSpec.describe EE::Gitlab::Checks::PushRules::TagCheck do
include_context 'push rules checks context'
describe '#validate!' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Bridge do
RSpec.describe Gitlab::Ci::Config::Entry::Bridge do
subject { described_class.new(config, name: :my_bridge) }
describe '.matching?' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::Gitlab::Ci::Config::Entry::Need do
RSpec.describe ::Gitlab::Ci::Config::Entry::Need do
subject(:need) { described_class.new(config) }
context 'with Bridge config' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::Gitlab::Ci::Config::Entry::Needs do
RSpec.describe ::Gitlab::Ci::Config::Entry::Needs do
subject(:needs) { described_class.new(config) }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Config do
RSpec.describe Gitlab::Ci::Config do
let(:template_name) { 'test_template' }
let(:template_repository) { create(:project, :custom_repo, files: { "gitlab-ci/#{template_name}.yml" => template_yml }) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Validate::Abilities do
RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::Abilities do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::Activity do
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Activity do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::JobActivity do
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::JobActivity do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::Size do
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Size do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe "CI YML Templates" do
RSpec.describe "CI YML Templates" do
using RSpec::Parameterized::TableSyntax
subject { Gitlab::Ci::YamlProcessor.new(content) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do
RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do
include ::EE::GeoHelpers
let(:batch_size) { 10 }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Cleanup::OrphanJobArtifactFiles do
RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFiles do
include ::EE::GeoHelpers
let(:null_logger) { Logger.new('/dev/null') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Database do
RSpec.describe Gitlab::Database do
include ::EE::GeoHelpers
describe '.read_only?' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Elastic::Helper do
RSpec.describe Gitlab::Elastic::Helper do
subject(:helper) { described_class.default }
shared_context 'with a legacy index' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::EtagCaching::Router do
RSpec.describe Gitlab::EtagCaching::Router do
it 'matches epic notes endpoint' do
result = described_class.match(
'/groups/my-group/and-subgroup/-/epics/1/notes'
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GitAccessDesign do
RSpec.describe Gitlab::GitAccessDesign do
include DesignManagementTestHelpers
using RSpec::Parameterized::TableSyntax
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::HookData::IssueBuilder do
RSpec.describe Gitlab::HookData::IssueBuilder do
let_it_be(:issue) { create(:issue) }
let(:builder) { described_class.new(issue) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy do
RSpec.describe EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy do
subject { described_class.new(export_into_project_id: project.id) }
describe 'validations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::LegacyTreeRestorer do
RSpec.describe Gitlab::ImportExport::Group::LegacyTreeRestorer do
include ImportExport::CommonUtil
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::LegacyTreeSaver do
RSpec.describe Gitlab::ImportExport::Group::LegacyTreeSaver do
describe 'saves the group tree into a json object' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeRestorer do
RSpec.describe Gitlab::ImportExport::Group::TreeRestorer do
include ImportExport::CommonUtil
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeSaver do
RSpec.describe Gitlab::ImportExport::Group::TreeSaver do
describe 'saves the group tree into a json object' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::ImportExport::Project::TreeRestorer do
RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do
include ImportExport::CommonUtil
let(:shared) { project.import_export_shared }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Project::TreeSaver do
RSpec.describe Gitlab::ImportExport::Project::TreeSaver do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::IpRestriction::Enforcer do
RSpec.describe Gitlab::IpRestriction::Enforcer do
describe '#allows_current_ip?' do
let(:group) { create(:group) }
let(:current_ip) { '192.168.0.2' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Metrics::Dashboard::ServiceSelector do
RSpec.describe Gitlab::Metrics::Dashboard::ServiceSelector do
include MetricsDashboardHelpers
describe '#call' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Metrics::Dashboard::Url do
RSpec.describe Gitlab::Metrics::Dashboard::Url do
describe '#clusters_regex' do
let(:url) do
Gitlab::Routing.url_helpers.namespace_project_cluster_url(
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Metrics::Samplers::DatabaseSampler do
RSpec.describe Gitlab::Metrics::Samplers::DatabaseSampler do
subject { described_class.new(described_class::SAMPLING_INTERVAL_SECONDS) }
describe '#sample' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Middleware::ReadOnly do
RSpec.describe Gitlab::Middleware::ReadOnly do
include Rack::Test::Methods
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::PathRegex do
RSpec.describe Gitlab::PathRegex do
describe '.container_image_regex' do
subject { described_class.container_image_regex }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Prometheus::MetricGroup do
RSpec.describe Gitlab::Prometheus::MetricGroup do
describe '.for_project' do
let!(:project_metric) { create(:prometheus_metric) }
let!(:common_metric) { create(:prometheus_metric, :common, group: :aws_elb) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::RepoPath do
RSpec.describe Gitlab::RepoPath do
describe '.find_project' do
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Scim::AttributeTransform do
RSpec.describe EE::Gitlab::Scim::AttributeTransform do
using RSpec::Parameterized::TableSyntax
describe '#valid?' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::Gitlab::Scim::DeprovisionService do
RSpec.describe ::EE::Gitlab::Scim::DeprovisionService do
describe '#execute' do
let_it_be(:identity) { create(:scim_identity, active: true) }
let_it_be(:group) { identity.group }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Scim::FilterParser do
RSpec.describe EE::Gitlab::Scim::FilterParser do
describe '#operator' do
it 'is extracted from the filter' do
expect(described_class.new('displayName ne ""').operator).to eq 'ne'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Scim::ParamsParser do
RSpec.describe EE::Gitlab::Scim::ParamsParser do
describe '#filter_params' do
it 'returns the correct filter attributes' do
filter = 'id eq "6ba81b08-77da"'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::Gitlab::Scim::ProvisioningService do
RSpec.describe ::EE::Gitlab::Scim::ProvisioningService do
describe '#execute' do
let(:group) { create(:group) }
let(:service) { described_class.new(group, service_params) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::EE::Gitlab::Scim::ReprovisionService do
RSpec.describe ::EE::Gitlab::Scim::ReprovisionService do
describe '#execute' do
let_it_be(:identity) { create(:scim_identity, active: false) }
let_it_be(:group) { identity.group }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::Scim::ValueParser do
RSpec.describe EE::Gitlab::Scim::ValueParser do
using RSpec::Parameterized::TableSyntax
describe '#type_cast' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::SearchResults do
RSpec.describe Gitlab::SearchResults do
let(:user) { build(:user) }
let_it_be(:compliance_project) { create(:project, :with_compliance_framework, name: 'foo') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::ServiceDesk do
RSpec.describe EE::Gitlab::ServiceDesk do
before do
stub_licensed_features(service_desk: true)
allow(::Gitlab::IncomingEmail).to receive(:enabled?).and_return(true)
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::SnippetSearchResults do
RSpec.describe Gitlab::SnippetSearchResults do
let_it_be(:snippet) { create(:snippet, title: 'foo', description: 'foo') }
let(:user) { snippet.author }
let(:com_value) { true }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Template::GitlabCiYmlTemplate do
RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do
describe '.all' do
let(:templates) { described_class.all.map(&:name) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::UrlBuilder do
RSpec.describe Gitlab::UrlBuilder do
subject { described_class }
describe '.build' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::UsageData do
RSpec.describe Gitlab::UsageData do
include UsageDataHelpers
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Verify::LfsObjects do
RSpec.describe Gitlab::Verify::LfsObjects do
before do
stub_lfs_object_storage
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Verify::Uploads do
RSpec.describe Gitlab::Verify::Uploads do
before do
stub_uploads_object_storage(AvatarUploader)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::Config do
RSpec.describe Elastic::Latest::Config do
describe '.document_type' do
it 'returns config' do
expect(described_class.document_type).to eq('doc')
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::GitClassProxy do
RSpec.describe Elastic::Latest::GitClassProxy do
let_it_be(:project) { create(:project, :repository) }
let(:included_class) { Elastic::Latest::RepositoryClassProxy }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::GitInstanceProxy do
RSpec.describe Elastic::Latest::GitInstanceProxy do
let(:project) { create(:project, :repository) }
let(:included_class) { Elastic::Latest::RepositoryInstanceProxy }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::ProjectWikiClassProxy do
RSpec.describe Elastic::Latest::ProjectWikiClassProxy do
let_it_be(:project) { create(:project, :wiki_repo) }
subject { described_class.new(project.wiki.repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::ProjectWikiInstanceProxy do
RSpec.describe Elastic::Latest::ProjectWikiInstanceProxy do
let_it_be(:project) { create(:project, :wiki_repo) }
subject { described_class.new(project.wiki) }
......
......@@ -3,7 +3,7 @@
require 'fast_spec_helper'
require 'support/helpers/stub_feature_flags'
describe Elastic::Latest::Routing do
RSpec.describe Elastic::Latest::Routing do
let(:proxified_class) { Issue }
let(:included_class) { Elastic::Latest::ApplicationClassProxy }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::Latest::SnippetInstanceProxy do
RSpec.describe Elastic::Latest::SnippetInstanceProxy do
let(:snippet) { create(:personal_snippet) }
subject { described_class.new(snippet) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::MultiVersionClassProxy do
RSpec.describe Elastic::MultiVersionClassProxy do
subject { described_class.new(ProjectSnippet) }
describe '#version' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::MultiVersionInstanceProxy do
RSpec.describe Elastic::MultiVersionInstanceProxy do
let(:snippet) { create(:project_snippet) }
subject { described_class.new(snippet) }
......
......@@ -2,7 +2,7 @@
require 'fast_spec_helper'
describe FlipperSession do
RSpec.describe FlipperSession do
describe '#flipper_id' do
context 'without passing in an ID' do
it 'returns a flipper_session:UUID' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods do
RSpec.describe GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods do
describe '#index_document' do
let(:project) { Project.new(id: 1) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::DataCollector do
RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
let_it_be(:user) { create(:user) }
around do |example|
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::GroupStageTimeSummary do
RSpec.describe Gitlab::Analytics::CycleAnalytics::GroupStageTimeSummary do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, :repository, namespace: group) }
let_it_be(:project_2) { create(:project, :repository, namespace: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::RequestParams do
RSpec.describe Gitlab::Analytics::CycleAnalytics::RequestParams do
let_it_be(:user) { create(:user) }
let_it_be(:root_group) { create(:group) }
let_it_be(:sub_group) { create(:group, parent: root_group) }
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueClosed do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueClosed do
it_behaves_like 'cycle analytics event'
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAddedToBoard do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAddedToBoard do
it_behaves_like 'cycle analytics event'
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAssociatedWithMilestone do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAssociatedWithMilestone do
it_behaves_like 'cycle analytics event'
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit do
it_behaves_like 'cycle analytics event'
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelAdded do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelAdded do
it_behaves_like 'cycle analytics event' do
let(:params) { { label: GroupLabel.new } }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelRemoved do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelRemoved do
it_behaves_like 'cycle analytics event' do
let(:params) { { label: GroupLabel.new } }
end
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLastEdited do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLastEdited do
it_behaves_like 'cycle analytics event'
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestClosed do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestClosed do
it_behaves_like 'cycle analytics event'
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelAdded do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelAdded do
it_behaves_like 'cycle analytics event' do
let(:params) { { label: GroupLabel.new } }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelRemoved do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelRemoved do
it_behaves_like 'cycle analytics event' do
let(:params) { { label: GroupLabel.new } }
end
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLastEdited do
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLastEdited do
it_behaves_like 'cycle analytics event'
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