Commit 22693930 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
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::Summary::Group::StageSummary do RSpec.describe Gitlab::Analytics::CycleAnalytics::Summary::Group::StageSummary do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :repository, namespace: group) } let(:project) { create(:project, :repository, namespace: group) }
let(:project_2) { create(:project, :repository, namespace: group) } let(:project_2) { create(:project, :repository, namespace: group) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::Summary::Group::StageTimeSummary do RSpec.describe Gitlab::Analytics::CycleAnalytics::Summary::Group::StageTimeSummary do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :repository, namespace: group) } let(:project) { create(:project, :repository, namespace: group) }
let(:project_2) { create(:project, :repository, namespace: group) } let(:project_2) { create(:project, :repository, namespace: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Analytics::TypeOfWork::TasksByType do RSpec.describe Gitlab::Analytics::TypeOfWork::TasksByType do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:other_group) { create(:group) } let_it_be(:other_group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Analytics do RSpec.describe Gitlab::Analytics do
describe '.productivity_analytics_enabled?' do describe '.productivity_analytics_enabled?' do
it 'is enabled by default' do it 'is enabled by default' do
expect(described_class).to be_productivity_analytics_enabled expect(described_class).to be_productivity_analytics_enabled
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::Events::Preloader do RSpec.describe Gitlab::Audit::Events::Preloader do
describe '.preload!' do describe '.preload!' do
let_it_be(:audit_events) { create_list(:audit_event, 2) } let_it_be(:audit_events) { create_list(:audit_event, 2) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::Levels::Group do RSpec.describe Gitlab::Audit::Levels::Group do
describe '#apply' do describe '#apply' do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) } let_it_be(:subgroup) { create(:group, parent: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::Levels::Instance do RSpec.describe Gitlab::Audit::Levels::Instance do
describe '#apply' do describe '#apply' do
let_it_be(:audit_events) do let_it_be(:audit_events) do
[ [
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::Levels::Project do RSpec.describe Gitlab::Audit::Levels::Project do
describe '#apply' do describe '#apply' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::NullAuthor do RSpec.describe Gitlab::Audit::NullAuthor do
subject { described_class } subject { described_class }
describe '.for' do describe '.for' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Audit::UnauthenticatedAuthor do RSpec.describe Gitlab::Audit::UnauthenticatedAuthor do
describe '#initialize' do describe '#initialize' do
it 'sets correct attributes' do it 'sets correct attributes' do
expect(described_class.new(name: 'Peppa Pig')) expect(described_class.new(name: 'Peppa Pig'))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::AuthFinders do RSpec.describe Gitlab::Auth::AuthFinders do
include described_class include described_class
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::DynamicSettings do RSpec.describe Gitlab::Auth::GroupSaml::DynamicSettings do
let(:saml_provider) { create(:saml_provider) } let(:saml_provider) { create(:saml_provider) }
let(:group) { saml_provider.group } let(:group) { saml_provider.group }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::FailureHandler do RSpec.describe Gitlab::Auth::GroupSaml::FailureHandler do
include Gitlab::Routing include Gitlab::Routing
let(:parent_handler) { double } let(:parent_handler) { double }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::GmaMembershipEnforcer do RSpec.describe Gitlab::Auth::GroupSaml::GmaMembershipEnforcer do
include ProjectForksHelper include ProjectForksHelper
let_it_be(:group) { create(:group_with_managed_accounts, :private) } let_it_be(:group) { create(:group_with_managed_accounts, :private) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::GroupLookup do RSpec.describe Gitlab::Auth::GroupSaml::GroupLookup do
let(:query_string) { 'group_path=the-group' } let(:query_string) { 'group_path=the-group' }
let(:path_info) { double } let(:path_info) { double }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::IdentityLinker do RSpec.describe Gitlab::Auth::GroupSaml::IdentityLinker do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:provider) { 'group_saml' } let(:provider) { 'group_saml' }
let(:uid) { user.email } let(:uid) { user.email }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::MembershipEnforcer do RSpec.describe Gitlab::Auth::GroupSaml::MembershipEnforcer do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:identity) { create(:group_saml_identity, user: user) } let(:identity) { create(:group_saml_identity, user: user) }
let(:group) { identity.saml_provider.group } let(:group) { identity.saml_provider.group }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::MembershipUpdater do RSpec.describe Gitlab::Auth::GroupSaml::MembershipUpdater do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:saml_provider) { create(:saml_provider) } let(:saml_provider) { create(:saml_provider) }
let(:group) { saml_provider.group } let(:group) { saml_provider.group }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::ResponseCheck do RSpec.describe Gitlab::Auth::GroupSaml::ResponseCheck do
describe 'validations' do describe 'validations' do
let(:name_id) { '123-456-789' } let(:name_id) { '123-456-789' }
let(:name_id_format) { 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' } let(:name_id_format) { 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::ResponseStore do RSpec.describe Gitlab::Auth::GroupSaml::ResponseStore do
let(:raw_response) { '<xml></xml>' } let(:raw_response) { '<xml></xml>' }
let(:session_id) { '123-456-789' } let(:session_id) { '123-456-789' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::SsoEnforcer do RSpec.describe Gitlab::Auth::GroupSaml::SsoEnforcer do
let(:saml_provider) { build_stubbed(:saml_provider, enforced_sso: true) } let(:saml_provider) { build_stubbed(:saml_provider, enforced_sso: true) }
let(:session) { {} } let(:session) { {} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::SsoState do RSpec.describe Gitlab::Auth::GroupSaml::SsoState do
let(:saml_provider_id) { 10 } let(:saml_provider_id) { 10 }
subject { described_class.new(saml_provider_id) } subject { described_class.new(saml_provider_id) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::TokenActor do RSpec.describe Gitlab::Auth::GroupSaml::TokenActor do
let(:saml_provider) { create(:saml_provider) } let(:saml_provider) { create(:saml_provider) }
let(:group) { saml_provider.group } let(:group) { saml_provider.group }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::User do RSpec.describe Gitlab::Auth::GroupSaml::User do
let(:uid) { 1234 } let(:uid) { 1234 }
let(:auth_hash) { OmniAuth::AuthHash.new(uid: uid) } let(:auth_hash) { OmniAuth::AuthHash.new(uid: uid) }
let(:saml_provider) { create(:saml_provider) } let(:saml_provider) { create(:saml_provider) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::GroupSaml::XmlResponse do RSpec.describe Gitlab::Auth::GroupSaml::XmlResponse do
let(:saml_provider) { create(:saml_provider) } let(:saml_provider) { create(:saml_provider) }
let(:group) { saml_provider.group } let(:group) { saml_provider.group }
let(:raw_response) do let(:raw_response) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Ldap::Access do RSpec.describe Gitlab::Auth::Ldap::Access do
include LdapHelpers include LdapHelpers
let(:user) { create(:omniauth_user) } let(:user) { create(:omniauth_user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Ldap::Adapter do RSpec.describe Gitlab::Auth::Ldap::Adapter do
include LdapHelpers include LdapHelpers
let(:adapter) { ldap_adapter('ldapmain') } let(:adapter) { ldap_adapter('ldapmain') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Ldap::Person do RSpec.describe Gitlab::Auth::Ldap::Person do
include LdapHelpers include LdapHelpers
let(:entry) { ldap_user_entry('john.doe') } let(:entry) { ldap_user_entry('john.doe') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Ldap::User do RSpec.describe Gitlab::Auth::Ldap::User do
include LdapHelpers include LdapHelpers
let(:ldap_user) { described_class.new(auth_hash) } let(:ldap_user) { described_class.new(auth_hash) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::OAuth::AuthHash do RSpec.describe Gitlab::Auth::OAuth::AuthHash do
let(:auth_hash) do let(:auth_hash) do
described_class.new( described_class.new(
OmniAuth::AuthHash.new( OmniAuth::AuthHash.new(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::OAuth::User do RSpec.describe Gitlab::Auth::OAuth::User do
include LdapHelpers include LdapHelpers
describe 'login through kerberos with linkable LDAP user' do describe 'login through kerberos with linkable LDAP user' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Saml::User do RSpec.describe Gitlab::Auth::Saml::User do
include LdapHelpers include LdapHelpers
include LoginHelpers include LoginHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Smartcard::Certificate do RSpec.describe Gitlab::Auth::Smartcard::Certificate do
let(:subject_dn) { '/O=Random Corp Ltd/CN=gitlab-user/emailAddress=gitlab-user@random-corp.org' } let(:subject_dn) { '/O=Random Corp Ltd/CN=gitlab-user/emailAddress=gitlab-user@random-corp.org' }
let(:issuer_dn) { '/O=Random Corp Ltd/CN=Random Corp' } let(:issuer_dn) { '/O=Random Corp Ltd/CN=Random Corp' }
let(:certificate_header) { 'certificate' } let(:certificate_header) { 'certificate' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Smartcard::LdapCertificate do RSpec.describe Gitlab::Auth::Smartcard::LdapCertificate do
let(:certificate_header) { 'certificate' } let(:certificate_header) { 'certificate' }
let(:openssl_certificate_store) { instance_double(OpenSSL::X509::Store) } let(:openssl_certificate_store) { instance_double(OpenSSL::X509::Store) }
let(:user_build_service) { instance_double(Users::BuildService) } let(:user_build_service) { instance_double(Users::BuildService) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Smartcard::SANExtension do RSpec.describe Gitlab::Auth::Smartcard::SANExtension do
let(:fqdn) { 'gitlab.example.com' } let(:fqdn) { 'gitlab.example.com' }
let(:extension_factory) { OpenSSL::X509::ExtensionFactory.new(nil, cert) } let(:extension_factory) { OpenSSL::X509::ExtensionFactory.new(nil, cert) }
let(:san_extension) { described_class.new(cert, fqdn) } let(:san_extension) { described_class.new(cert, fqdn) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Smartcard::SessionEnforcer do RSpec.describe Gitlab::Auth::Smartcard::SessionEnforcer do
describe '#update_session' do describe '#update_session' do
let(:session) { {} } let(:session) { {} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth::Smartcard::Session do RSpec.describe Gitlab::Auth::Smartcard::Session do
describe '#active?' do describe '#active?' do
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth do RSpec.describe Gitlab::Auth do
let(:gl_auth) { described_class } let(:gl_auth) { described_class }
let!(:user) do let!(:user) do
create(:user, create(:user,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::AuthorityAnalyzer do RSpec.describe Gitlab::AuthorityAnalyzer do
describe '#calculate' do describe '#calculate' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:author) { create(:user) } let(:author) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::BackgroundMigration::FixOrphanPromotedIssues, schema: 20200207185149 do RSpec.describe Gitlab::BackgroundMigration::FixOrphanPromotedIssues, schema: 20200207185149 do
let(:users) { table(:users) } let(:users) { table(:users) }
let(:namespaces) { table(:namespaces) } let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) } let(:projects) { table(:projects) }
......
...@@ -5,7 +5,7 @@ require './db/post_migrate/20191115115043_migrate_epic_mentions_to_db' ...@@ -5,7 +5,7 @@ require './db/post_migrate/20191115115043_migrate_epic_mentions_to_db'
require './db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db' require './db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db'
require './db/post_migrate/20200124110831_migrate_design_notes_mentions_to_db' require './db/post_migrate/20200124110831_migrate_design_notes_mentions_to_db'
describe Gitlab::BackgroundMigration::UserMentions::CreateResourceUserMention do RSpec.describe Gitlab::BackgroundMigration::UserMentions::CreateResourceUserMention do
include MigrationsHelpers include MigrationsHelpers
context 'when migrating data' do context 'when migrating data' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Checks::ChangeAccess do RSpec.describe Gitlab::Checks::ChangeAccess do
describe '#exec' do describe '#exec' do
include_context 'push rules checks context' include_context 'push rules checks context'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Checks::DiffCheck do RSpec.describe Gitlab::Checks::DiffCheck do
include FakeBlobHelpers include FakeBlobHelpers
include_context 'push rules checks context' include_context 'push rules checks context'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Job do RSpec.describe Gitlab::Ci::Config::Entry::Job do
let(:entry) { described_class.new(config, name: :rspec) } let(:entry) { described_class.new(config, name: :rspec) }
describe 'validations' do describe 'validations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Config::Required::Processor do RSpec.describe Gitlab::Ci::Config::Required::Processor do
subject { described_class.new(config).perform } subject { described_class.new(config).perform }
let(:config) { { image: 'ruby:2.5.3' } } let(:config) { { image: 'ruby:2.5.3' } }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do RSpec.describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do
describe '#parse!' do describe '#parse!' do
let(:report) { Gitlab::Ci::Reports::LicenseScanning::Report.new } let(:report) { Gitlab::Ci::Reports::LicenseScanning::Report.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Metrics::Generic do RSpec.describe Gitlab::Ci::Parsers::Metrics::Generic do
describe '#parse!' do describe '#parse!' do
subject { described_class.new.parse!(data, report) } subject { described_class.new.parse!(data, report) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::Common do RSpec.describe Gitlab::Ci::Parsers::Security::Common do
describe '#parse!' do describe '#parse!' do
let(:artifact) { build(:ee_ci_job_artifact, :dependency_scanning) } let(:artifact) { build(:ee_ci_job_artifact, :dependency_scanning) }
let(:report) { Gitlab::Ci::Reports::Security::Report.new(artifact.file_type, 'sha', 2.weeks.ago) } let(:report) { Gitlab::Ci::Reports::Security::Report.new(artifact.file_type, 'sha', 2.weeks.ago) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::ContainerScanning do RSpec.describe Gitlab::Ci::Parsers::Security::ContainerScanning do
let(:parser) { described_class.new } let(:parser) { described_class.new }
let(:project) { artifact.project } let(:project) { artifact.project }
let(:pipeline) { artifact.job.pipeline } let(:pipeline) { artifact.job.pipeline }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::Dast do RSpec.describe Gitlab::Ci::Parsers::Security::Dast do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
describe '#parse!' do describe '#parse!' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::DependencyList do RSpec.describe Gitlab::Ci::Parsers::Security::DependencyList do
let(:parser) { described_class.new(project, sha) } let(:parser) { described_class.new(project, sha) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:sha) { '4242424242424242' } let(:sha) { '4242424242424242' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::DependencyScanning do RSpec.describe Gitlab::Ci::Parsers::Security::DependencyScanning do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
describe '#parse!' do describe '#parse!' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::Formatters::Dast do RSpec.describe Gitlab::Ci::Parsers::Security::Formatters::Dast do
let(:formatter) { described_class.new(parsed_report) } let(:formatter) { described_class.new(parsed_report) }
let(:parsed_report) do let(:parsed_report) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do RSpec.describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do
let(:formatter) { described_class.new(project, sha) } let(:formatter) { described_class.new(project, sha) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:sha) { '4242424242424242' } let(:sha) { '4242424242424242' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::Sast do RSpec.describe Gitlab::Ci::Parsers::Security::Sast do
describe '#parse!' do describe '#parse!' do
subject(:parser) { described_class.new } subject(:parser) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::ScannedResources do RSpec.describe Gitlab::Ci::Parsers::Security::ScannedResources do
describe '#scanned_resources_count' do describe '#scanned_resources_count' do
let(:parser) { described_class.new } let(:parser) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Parsers::Security::SecretDetection do RSpec.describe Gitlab::Ci::Parsers::Security::SecretDetection do
describe '#parse!' do describe '#parse!' do
subject(:parser) { described_class.new } subject(:parser) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity do RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let_it_be(:project) { create(:project, namespace: namespace) } let_it_be(:project) { create(:project, namespace: namespace) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::JobActivity do RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::JobActivity do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let_it_be(:project) { create(:project, namespace: namespace) } let_it_be(:project) { create(:project, namespace: namespace) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::Size do RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Size do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) } let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::DependencyList::Dependency do RSpec.describe Gitlab::Ci::Reports::DependencyList::Dependency do
let(:dependency_nokogiri) { build(:dependency, :nokogiri, :with_vulnerabilities) } let(:dependency_nokogiri) { build(:dependency, :nokogiri, :with_vulnerabilities) }
context 'initialize' do context 'initialize' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
require 'benchmark/ips' require 'benchmark/ips'
describe Gitlab::Ci::Reports::DependencyList::Report do RSpec.describe Gitlab::Ci::Reports::DependencyList::Report do
let(:report) { described_class.new } let(:report) { described_class.new }
describe '#add_dependency' do describe '#add_dependency' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::LicenseScanning::License do RSpec.describe Gitlab::Ci::Reports::LicenseScanning::License do
describe 'equality' do describe 'equality' do
let(:blank) { described_class.new(id: nil, name: nil, url: nil) } let(:blank) { described_class.new(id: nil, name: nil, url: nil) }
let(:v1_mit) { described_class.new(id: nil, name: 'MIT', url: '') } let(:v1_mit) { described_class.new(id: nil, name: 'MIT', url: '') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::LicenseScanning::Report do RSpec.describe Gitlab::Ci::Reports::LicenseScanning::Report do
include LicenseScanningReportHelpers include LicenseScanningReportHelpers
describe '#by_license_name' do describe '#by_license_name' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::LicenseScanning::ReportsComparer do RSpec.describe Gitlab::Ci::Reports::LicenseScanning::ReportsComparer do
let(:report_1) { build :ci_reports_license_scanning_report, :report_1 } let(:report_1) { build :ci_reports_license_scanning_report, :report_1 }
let(:report_2) { build :ci_reports_license_scanning_report, :report_2 } let(:report_2) { build :ci_reports_license_scanning_report, :report_2 }
let(:report_comparer) { described_class.new(report_1, report_2) } let(:report_comparer) { described_class.new(report_1, report_2) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Metrics::Report do RSpec.describe Gitlab::Ci::Reports::Metrics::Report do
let(:report) { described_class.new } let(:report) { described_class.new }
describe '#add_metric' do describe '#add_metric' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Metrics::ReportsComparer do RSpec.describe Gitlab::Ci::Reports::Metrics::ReportsComparer do
let(:first_report) { build :ci_reports_metrics_report, :base_metrics } let(:first_report) { build :ci_reports_metrics_report, :base_metrics }
let(:second_report) { build :ci_reports_metrics_report, :head_metrics } let(:second_report) { build :ci_reports_metrics_report, :head_metrics }
let(:report_comparer) { described_class.new(first_report, second_report) } let(:report_comparer) { described_class.new(first_report, second_report) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::AggregatedReport do RSpec.describe Gitlab::Ci::Reports::Security::AggregatedReport do
subject { described_class.new(reports, occurrences) } subject { described_class.new(reports, occurrences) }
let(:reports) { build_list(:ci_reports_security_report, 1) } let(:reports) { build_list(:ci_reports_security_report, 1) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Identifier do RSpec.describe Gitlab::Ci::Reports::Security::Identifier do
describe '#initialize' do describe '#initialize' do
subject { described_class.new(**params) } subject { described_class.new(**params) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Locations::ContainerScanning do RSpec.describe Gitlab::Ci::Reports::Security::Locations::ContainerScanning do
let(:params) do let(:params) do
{ {
image: 'registry.gitlab.com/my/project:latest', image: 'registry.gitlab.com/my/project:latest',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Locations::Dast do RSpec.describe Gitlab::Ci::Reports::Security::Locations::Dast do
let(:params) do let(:params) do
{ {
hostname: 'my-app.com', hostname: 'my-app.com',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Locations::DependencyScanning do RSpec.describe Gitlab::Ci::Reports::Security::Locations::DependencyScanning do
let(:params) do let(:params) do
{ {
file_path: 'app/pom.xml', file_path: 'app/pom.xml',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Locations::Sast do RSpec.describe Gitlab::Ci::Reports::Security::Locations::Sast do
let(:params) do let(:params) do
{ {
file_path: 'src/main/App.java', file_path: 'src/main/App.java',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Locations::SecretDetection do RSpec.describe Gitlab::Ci::Reports::Security::Locations::SecretDetection do
let(:params) do let(:params) do
{ {
file_path: 'src/main/App.java', file_path: 'src/main/App.java',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Occurrence do RSpec.describe Gitlab::Ci::Reports::Security::Occurrence do
describe '#initialize' do describe '#initialize' do
subject { described_class.new(**params) } subject { described_class.new(**params) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Report do RSpec.describe Gitlab::Ci::Reports::Security::Report do
let(:report) { described_class.new('sast', commit_sha, created_at) } let(:report) { described_class.new('sast', commit_sha, created_at) }
let(:commit_sha) { "d8978e74745e18ce44d88814004d4255ac6a65bb" } let(:commit_sha) { "d8978e74745e18ce44d88814004d4255ac6a65bb" }
let(:created_at) { 2.weeks.ago } let(:created_at) { 2.weeks.ago }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Reports do RSpec.describe Gitlab::Ci::Reports::Security::Reports do
let(:commit_sha) { '20410773a37f49d599e5f0d45219b39304763538' } let(:commit_sha) { '20410773a37f49d599e5f0d45219b39304763538' }
let(:security_reports) { described_class.new(commit_sha) } let(:security_reports) { described_class.new(commit_sha) }
let(:artifact) { create(:ee_ci_job_artifact, :sast) } let(:artifact) { create(:ee_ci_job_artifact, :sast) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::Scanner do RSpec.describe Gitlab::Ci::Reports::Security::Scanner do
describe '#initialize' do describe '#initialize' do
subject { described_class.new(**params) } subject { described_class.new(**params) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Reports::Security::VulnerabilityReportsComparer do RSpec.describe Gitlab::Ci::Reports::Security::VulnerabilityReportsComparer do
let(:identifier) { build(:vulnerabilities_identifier) } let(:identifier) { build(:vulnerabilities_identifier) }
let(:base_vulnerability) { build(:vulnerabilities_occurrence, report_type: :sast, identifiers: [identifier], location_fingerprint: '123', confidence: Vulnerabilities::Occurrence::CONFIDENCE_LEVELS[:high], severity: Vulnerabilities::Occurrence::SEVERITY_LEVELS[:critical]) } let(:base_vulnerability) { build(:vulnerabilities_occurrence, report_type: :sast, identifiers: [identifier], location_fingerprint: '123', confidence: Vulnerabilities::Occurrence::CONFIDENCE_LEVELS[:high], severity: Vulnerabilities::Occurrence::SEVERITY_LEVELS[:critical]) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Container-Scanning.gitlab-ci.yml' do RSpec.describe 'Container-Scanning.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Container-Scanning') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Container-Scanning') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'DAST.gitlab-ci.yml' do RSpec.describe 'DAST.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('DAST') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('DAST') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Dependency-Scanning.gitlab-ci.yml' do RSpec.describe 'Dependency-Scanning.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Dependency-Scanning') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Dependency-Scanning') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'License-Scanning.gitlab-ci.yml' do RSpec.describe 'License-Scanning.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('License-Scanning') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('License-Scanning') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'SAST.gitlab-ci.yml' do RSpec.describe 'SAST.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('SAST') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('SAST') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::YamlProcessor do RSpec.describe Gitlab::Ci::YamlProcessor do
describe 'Bridge Needs' do describe 'Bridge Needs' do
let(:config) do let(:config) do
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CIDR do RSpec.describe Gitlab::CIDR do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
context 'validation' do context 'validation' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::Entry do RSpec.describe Gitlab::CodeOwners::Entry do
subject(:entry) do subject(:entry) do
described_class.new( described_class.new(
"/**/file", "/**/file",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::File do RSpec.describe Gitlab::CodeOwners::File do
include FakeBlobHelpers include FakeBlobHelpers
let(:project) { build(:project) } let(:project) { build(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::GroupsLoader do RSpec.describe Gitlab::CodeOwners::GroupsLoader do
let(:text) do let(:text) do
<<~TXT <<~TXT
This is a long text that mentions some groups. This is a long text that mentions some groups.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::Loader do RSpec.describe Gitlab::CodeOwners::Loader do
include FakeBlobHelpers include FakeBlobHelpers
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::ReferenceExtractor do RSpec.describe Gitlab::CodeOwners::ReferenceExtractor do
let(:text) do let(:text) do
<<~TXT <<~TXT
This is a long text that mentions some users. This is a long text that mentions some users.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::UsersLoader do RSpec.describe Gitlab::CodeOwners::UsersLoader do
let(:text) do let(:text) do
<<~TXT <<~TXT
This is a long text that mentions some users. This is a long text that mentions some users.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners::Validator do RSpec.describe Gitlab::CodeOwners::Validator do
include FakeBlobHelpers include FakeBlobHelpers
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeOwners do RSpec.describe Gitlab::CodeOwners do
include FakeBlobHelpers include FakeBlobHelpers
let!(:code_owner) { create(:user, username: 'owner-1') } let!(:code_owner) { create(:user, username: 'owner-1') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Com do RSpec.describe Gitlab::Com do
it { expect(described_class.l1_cache_backend).to eq(Gitlab::ProcessMemoryCache.cache_backend) } it { expect(described_class.l1_cache_backend).to eq(Gitlab::ProcessMemoryCache.cache_backend) }
it { expect(described_class.l2_cache_backend).to eq(Rails.cache) } it { expect(described_class.l2_cache_backend).to eq(Rails.cache) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::ConanToken do RSpec.describe Gitlab::ConanToken do
let(:base_secret) { SecureRandom.base64(64) } let(:base_secret) { SecureRandom.base64(64) }
let(:jwt_secret) do let(:jwt_secret) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ContributionAnalytics::DataCollector do RSpec.describe Gitlab::ContributionAnalytics::DataCollector do
describe '#totals' do describe '#totals' do
it 'collects event counts grouped by users by calling #base_query' do it 'collects event counts grouped by users by calling #base_query' do
group = create(:group) group = create(:group)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CustomFileTemplates do RSpec.describe Gitlab::CustomFileTemplates do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:instance_template_project) { create(:project, :custom_repo, files: template_files('instance')) } let_it_be(:instance_template_project) { create(:project, :custom_repo, files: template_files('instance')) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Database::LoadBalancing::ActiveRecordProxy do RSpec.describe Gitlab::Database::LoadBalancing::ActiveRecordProxy do
describe '#connection' do describe '#connection' do
it 'returns a connection proxy' do it 'returns a connection proxy' do
dummy = Class.new do dummy = Class.new do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Database::LoadBalancing::ConnectionProxy do RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do
let(:proxy) { described_class.new } let(:proxy) { described_class.new }
describe '#select' do describe '#select' do
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment