Commit e61145f4 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'pl-fast-spec-helper' into 'master'

Fix specs which are incompatible with fast_spec_helper

See merge request gitlab-org/gitlab!78543
parents cf943277 307af28b
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require_relative './config_shared_examples' require_relative './config_shared_examples'
RSpec.describe Elastic::Latest::Config do RSpec.describe Elastic::Latest::Config do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'rspec-parameterized'
RSpec.describe Elastic::Latest::CustomLanguageAnalyzers do RSpec.describe Elastic::Latest::CustomLanguageAnalyzers do
describe '.custom_analyzers_mappings' do describe '.custom_analyzers_mappings' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require_relative './config_shared_examples' require_relative './config_shared_examples'
RSpec.describe Elastic::Latest::IssueConfig do RSpec.describe Elastic::Latest::IssueConfig do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require_relative './config_shared_examples' require_relative './config_shared_examples'
RSpec.describe Elastic::Latest::MergeRequestConfig do RSpec.describe Elastic::Latest::MergeRequestConfig do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require_relative './config_shared_examples' require_relative './config_shared_examples'
RSpec.describe Elastic::Latest::NoteConfig do RSpec.describe Elastic::Latest::NoteConfig do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'support/helpers/stub_feature_flags'
RSpec.describe Elastic::Latest::Routing do RSpec.describe Elastic::Latest::Routing do
let(:proxified_class) { Issue } let(:proxified_class) { Issue }
let(:included_class) { Elastic::Latest::ApplicationClassProxy } let(:included_class) { Elastic::Latest::ApplicationClassProxy }
subject { included_class.new(proxified_class) }
let(:project_ids) { [1, 2, 3] } let(:project_ids) { [1, 2, 3] }
let(:project_routing) { 'project_1,project_2,project_3' } let(:project_routing) { 'project_1,project_2,project_3' }
subject { included_class.new(proxified_class) }
describe '#search' do describe '#search' do
it 'calls routing_options with empty hash' do it 'calls routing_options with empty hash' do
expect(subject).to receive(:routing_options).and_return({}) expect(subject).to receive(:routing_options).and_return({})
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_dependency 'action_controller'
RSpec.describe Gitlab::Insights::Validators::ParamsValidator do RSpec.describe Gitlab::Insights::Validators::ParamsValidator do
subject { described_class.new(params).validate! } subject { described_class.new(params).validate! }
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../../../lib/ee/gitlab/patch/draw_route'
RSpec.describe Gitlab::Patch::DrawRoute do RSpec.describe Gitlab::Patch::DrawRoute do
subject do subject do
Class.new do Class.new do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Elastic::MigrationObsolete do RSpec.describe Elastic::MigrationObsolete do
let(:migration_class) do let(:migration_class) do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Elastic::MigrationOptions do RSpec.describe Elastic::MigrationOptions do
let(:migration_class) do let(:migration_class) do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../config/initializers/net_http_patch'
RSpec.describe 'Net::HTTP patch proxy user and password encoding' do RSpec.describe 'Net::HTTP patch proxy user and password encoding' do
let(:net_http) { Net::HTTP.new('hostname.example') } let(:net_http) { Net::HTTP.new('hostname.example') }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_dependency 'active_model'
RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules::Rule do RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules::Rule do
let(:factory) do let(:factory) do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_dependency 'active_model'
RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules do RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules do
let(:factory) do let(:factory) do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_dependency 'active_model'
RSpec.describe ::Gitlab::Ci::Config::Entry::Include do RSpec.describe ::Gitlab::Ci::Config::Entry::Include do
subject(:include_entry) { described_class.new(config) } subject(:include_entry) { described_class.new(config) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'support/helpers/stub_feature_flags'
require_dependency 'active_model'
RSpec.describe Gitlab::Ci::Config::Entry::Policy do RSpec.describe Gitlab::Ci::Config::Entry::Policy do
let(:entry) { described_class.new(config) } let(:entry) { described_class.new(config) }
...@@ -47,6 +45,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do ...@@ -47,6 +45,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do
end end
context 'when using unsafe regexp' do context 'when using unsafe regexp' do
# When removed we could use `require 'fast_spec_helper'` again.
include StubFeatureFlags include StubFeatureFlags
let(:config) { ['/^(?!master).+/'] } let(:config) { ['/^(?!master).+/'] }
...@@ -107,6 +106,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do ...@@ -107,6 +106,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do
end end
context 'when using unsafe regexp' do context 'when using unsafe regexp' do
# When removed we could use `require 'fast_spec_helper'` again.
include StubFeatureFlags include StubFeatureFlags
let(:config) { { refs: ['/^(?!master).+/'] } } let(:config) { { refs: ['/^(?!master).+/'] } }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require 'support/helpers/stubbed_feature'
require 'support/helpers/stub_feature_flags'
RSpec.describe Gitlab::Ci::Config::Normalizer::MatrixStrategy do RSpec.describe Gitlab::Ci::Config::Normalizer::MatrixStrategy do
include StubFeatureFlags
describe '.applies_to?' do describe '.applies_to?' do
subject { described_class.applies_to?(config) } subject { described_class.applies_to?(config) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'rspec-parameterized'
RSpec.describe Gitlab::Cluster::LifecycleEvents do RSpec.describe Gitlab::Cluster::LifecycleEvents do
# we create a new instance to ensure that we do not touch existing hooks # we create a new instance to ensure that we do not touch existing hooks
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::Database::BackgroundMigration::BatchMetrics do RSpec.describe Gitlab::Database::BackgroundMigration::BatchMetrics do
let(:batch_metrics) { described_class.new } let(:batch_metrics) { described_class.new }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'rspec-parameterized'
RSpec.describe Gitlab::ErrorTracking::ContextPayloadGenerator do RSpec.describe Gitlab::ErrorTracking::ContextPayloadGenerator do
subject(:generator) { described_class.new } subject(:generator) { described_class.new }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::ErrorTracking::LogFormatter do RSpec.describe Gitlab::ErrorTracking::LogFormatter do
let(:exception) { StandardError.new('boom') } let(:exception) { StandardError.new('boom') }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::FeatureCategories do RSpec.describe Gitlab::FeatureCategories do
let(:fake_categories) { %w(foo bar) } let(:fake_categories) { %w(foo bar) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe ::Gitlab::Graphql::Authorize::ObjectAuthorization do RSpec.describe ::Gitlab::Graphql::Authorize::ObjectAuthorization do
describe '#ok?' do describe '#ok?' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require 'test_prof/recipes/rspec/let_it_be'
RSpec.describe ::Gitlab::Graphql::BatchKey do RSpec.describe ::Gitlab::Graphql::BatchKey do
let_it_be(:rect) { Struct.new(:len, :width) } let(:rect) { Struct.new(:len, :width) }
let_it_be(:circle) { Struct.new(:radius) } let(:circle) { Struct.new(:radius) }
let(:lookahead) { nil } let(:lookahead) { nil }
let(:object) { rect.new(2, 3) } let(:object) { rect.new(2, 3) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
require 'fast_spec_helper'
require "test_prof/recipes/rspec/let_it_be"
RSpec.describe Gitlab::Graphql::Queries do RSpec.describe Gitlab::Graphql::Queries do
shared_examples 'a valid GraphQL query for the blog schema' do shared_examples 'a valid GraphQL query for the blog schema' do
......
# frozen_string_literal: true # frozen_string_literal: true
require "fast_spec_helper"
require "support/graphql/fake_tracer" require 'spec_helper'
require "support/graphql/fake_query_type"
RSpec.describe Gitlab::Graphql::Tracers::ApplicationContextTracer do RSpec.describe Gitlab::Graphql::Tracers::ApplicationContextTracer do
let(:tracer_spy) { spy('tracer_spy') } let(:tracer_spy) { spy('tracer_spy') }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'rspec-parameterized'
RSpec.describe Gitlab::ImportExport::Config do RSpec.describe Gitlab::ImportExport::Config do
let(:yaml_file) { described_class.new } let(:yaml_file) { described_class.new }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::IncidentManagement::PagerDuty::IncidentIssueDescription do RSpec.describe Gitlab::IncidentManagement::PagerDuty::IncidentIssueDescription do
describe '#to_s' do describe '#to_s' do
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../../../lib/gitlab/kubernetes/pod_cmd'
RSpec.describe Gitlab::Kubernetes::KubectlCmd do RSpec.describe Gitlab::Kubernetes::KubectlCmd do
describe '.delete' do describe '.delete' do
it 'constructs string properly' do it 'constructs string properly' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::Regex do RSpec.describe Gitlab::Regex do
shared_examples_for 'project/group name chars regex' do shared_examples_for 'project/group name chars regex' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Gitlab::RequestProfiler::Profile do RSpec.describe Gitlab::RequestProfiler::Profile do
let(:profile) { described_class.new(filename) } let(:profile) { described_class.new(filename) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'support/shared_examples/lib/gitlab/malicious_regexp_shared_examples'
require 'support/helpers/stub_feature_flags'
RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do
describe '.matches_syntax?' do describe '.matches_syntax?' do
...@@ -77,6 +75,7 @@ RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do ...@@ -77,6 +75,7 @@ RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do
include StubFeatureFlags include StubFeatureFlags
before do before do
# When removed we could use `require 'fast_spec_helper'` again.
stub_feature_flags(allow_unsafe_ruby_regexp: true) stub_feature_flags(allow_unsafe_ruby_regexp: true)
allow(Gitlab::UntrustedRegexp).to receive(:new).and_raise(RegexpError) allow(Gitlab::UntrustedRegexp).to receive(:new).and_raise(RegexpError)
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'support/helpers/file_read_helpers'
require 'support/webmock'
RSpec.describe Gitlab::Webpack::FileLoader do RSpec.describe Gitlab::Webpack::FileLoader do
include FileReadHelpers include FileReadHelpers
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe Peek::Views::DetailedView, :request_store do RSpec.describe Peek::Views::DetailedView, :request_store do
context 'when a class defines thresholds' do context 'when a class defines thresholds' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require 'oj'
RSpec.describe Serializers::Json do RSpec.describe Serializers::Json do
describe '.dump' do describe '.dump' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require 'oj'
RSpec.describe Serializers::SymbolizedJson do RSpec.describe Serializers::SymbolizedJson do
describe '.dump' do describe '.dump' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
MAIL_ROOM_CONFIG_ENABLED_SAMPLE = MAIL_ROOM_CONFIG_ENABLED_SAMPLE =
":mailboxes:\n"\ ":mailboxes:\n"\
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../app/models/instance_metadata'
require_relative '../../app/models/instance_metadata/kas'
RSpec.describe InstanceMetadata do RSpec.describe InstanceMetadata do
it 'has the correct properties' do it 'has the correct properties' do
......
# frozen_string_literal: true # frozen_string_literal: true
require_relative '../../fast_spec_helper' require 'spec_helper'
require_relative '../../../tooling/docs/deprecation_handling' require_relative '../../../tooling/docs/deprecation_handling'
require_relative '../../support/helpers/next_instance_of'
RSpec.describe Docs::DeprecationHandling do RSpec.describe Docs::DeprecationHandling do
include ::NextInstanceOf
let(:type) { 'deprecation' } let(:type) { 'deprecation' }
subject { described_class.new(type).render } subject { described_class.new(type).render }
......
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