Commit ffcf4735 authored by Stan Hu's avatar Stan Hu

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

RSpec zero monkey patching mode

See merge request gitlab-org/gitlab!33722
parents 3f472c95 b1823aea
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::JobsFinder do
RSpec.describe Security::JobsFinder do
it 'is an abstract class that does not permit instantiation' do
expect { described_class.new(pipeline: nil) }.to raise_error(
NotImplementedError,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::LicenseComplianceJobsFinder do
RSpec.describe Security::LicenseComplianceJobsFinder do
it_behaves_like ::Security::JobsFinder, described_class.allowed_job_types
describe "#execute" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::PipelineVulnerabilitiesFinder do
RSpec.describe Security::PipelineVulnerabilitiesFinder do
def disable_deduplication
allow(::Security::MergeReportsService).to receive(:new) do |*args|
instance_double('NoDeduplicationMergeReportsService', execute: args.last)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::SecurityJobsFinder do
RSpec.describe Security::SecurityJobsFinder do
it_behaves_like ::Security::JobsFinder, described_class.allowed_job_types
describe "#execute" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::VulnerabilitiesFinder do
RSpec.describe Security::VulnerabilitiesFinder do
let_it_be(:project) { create(:project) }
let_it_be(:vulnerability1) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::VulnerabilityFindingsFinder do
RSpec.describe Security::VulnerabilityFindingsFinder do
describe '#execute' do
let_it_be(:project1) { create(:project, :private, :repository) }
let_it_be(:project2) { create(:project, :private, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Security::VulnerableProjectsFinder do
RSpec.describe Security::VulnerableProjectsFinder do
describe '#execute' do
let(:projects) { Project.all }
let!(:safe_project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SnippetsFinder do
RSpec.describe SnippetsFinder do
let_it_be(:group) { create(:group, :public) }
let_it_be(:project) { create(:project, :public, group: group) }
let_it_be(:private_project_snippet) { create(:project_snippet, :private, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SoftwareLicensePoliciesFinder do
RSpec.describe SoftwareLicensePoliciesFinder do
let(:project) { create(:project) }
let(:software_license_policy) { create(:software_license_policy, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StatusPage::IncidentCommentsFinder do
RSpec.describe StatusPage::IncidentCommentsFinder do
let_it_be(:user) { create(:user) }
let_it_be(:issue) { create(:issue) }
let_it_be(:unrelated_issue) { create(:issue, project: issue.project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StatusPage::IncidentsFinder do
RSpec.describe StatusPage::IncidentsFinder do
let_it_be(:project) { create(:project) }
let_it_be(:issues) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TemplateFinder do
RSpec.describe TemplateFinder do
using RSpec::Parameterized::TableSyntax
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UsersFinder do
RSpec.describe UsersFinder do
describe '#execute' do
include_context 'UsersFinder#execute filter by project context'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::ResolvesIssuable do
RSpec.describe Mutations::ResolvesIssuable do
let_it_be(:mutation_class) do
Class.new(Mutations::BaseMutation) do
include Mutations::ResolvesIssuable
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::BoardListsResolver do
RSpec.describe Resolvers::BoardListsResolver do
include GraphqlHelpers
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::IssuesResolver do
RSpec.describe Resolvers::IssuesResolver do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::NamespaceProjectsResolver do
RSpec.describe Resolvers::NamespaceProjectsResolver do
include GraphqlHelpers
let(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['BoardList'] do
RSpec.describe GitlabSchema.types['BoardList'] do
it 'has specific fields' do
expected_fields = %w[milestone max_issue_count max_issue_weight assignee]
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Board'] do
RSpec.describe GitlabSchema.types['Board'] do
it 'includes the ee specific fields' do
expect(described_class).to have_graphql_field('weight')
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Group'] do
RSpec.describe GitlabSchema.types['Group'] do
describe 'nested epic request' do
it { expect(described_class).to have_graphql_field(:epicsEnabled) }
it { expect(described_class).to have_graphql_field(:epics) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['IssueSort'] do
RSpec.describe GitlabSchema.types['IssueSort'] do
it { expect(described_class.graphql_name).to eq('IssueSort') }
it_behaves_like 'common sort values'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Boards::Lists::UpdateLimitMetrics do
RSpec.describe Mutations::Boards::Lists::UpdateLimitMetrics do
let_it_be(:group) { create(:group, :private) }
let_it_be(:board) { create(:board, group: group) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Epics::AddIssue do
RSpec.describe Mutations::Epics::AddIssue do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
let_it_be(:epic) { create(:epic, group: group) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Mutations::InstanceSecurityDashboard::AddProject do
RSpec.describe Mutations::InstanceSecurityDashboard::AddProject do
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::InstanceSecurityDashboard::RemoveProject do
RSpec.describe Mutations::InstanceSecurityDashboard::RemoveProject do
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Issues::SetIteration do
RSpec.describe Mutations::Issues::SetIteration do
let(:issue) { create(:issue) }
let(:user) { create(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Mutations::Issues::SetWeight do
RSpec.describe Mutations::Issues::SetWeight do
let(:issue) { create(:issue) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::Issues::Update do
RSpec.describe Mutations::Issues::Update do
it_behaves_like 'updating health status' do
let(:resource) { create(:issue) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::MergeRequests::SetAssignees do
RSpec.describe Mutations::MergeRequests::SetAssignees do
let(:merge_request) { create(:merge_request) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::RequirementsManagement::CreateRequirement do
RSpec.describe Mutations::RequirementsManagement::CreateRequirement do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutations::RequirementsManagement::UpdateRequirement do
RSpec.describe Mutations::RequirementsManagement::UpdateRequirement do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:requirement) { create(:requirement, project: project) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Mutations::Vulnerabilities::Dismiss do
RSpec.describe Mutations::Vulnerabilities::Dismiss do
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::EpicIssuesResolver do
RSpec.describe Resolvers::EpicIssuesResolver do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::EpicsResolver do
RSpec.describe Resolvers::EpicsResolver do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::Geo::GeoNodeResolver do
RSpec.describe Resolvers::Geo::GeoNodeResolver do
include GraphqlHelpers
include EE::GeoHelpers
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe Resolvers::Geo::PackageFileRegistriesResolver do
RSpec.describe Resolvers::Geo::PackageFileRegistriesResolver do
it_behaves_like 'a Geo registries resolver', :package_file_registry
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::InstanceSecurityDashboard::ProjectsResolver do
RSpec.describe Resolvers::InstanceSecurityDashboard::ProjectsResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::InstanceSecurityDashboardResolver do
RSpec.describe Resolvers::InstanceSecurityDashboardResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::IterationsResolver do
RSpec.describe Resolvers::IterationsResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::PackagesResolver do
RSpec.describe Resolvers::PackagesResolver do
include GraphqlHelpers
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::RequirementsManagement::RequirementsResolver do
RSpec.describe Resolvers::RequirementsManagement::RequirementsResolver do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::RequirementsManagement::TestReportsResolver do
RSpec.describe Resolvers::RequirementsManagement::TestReportsResolver do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::TimelogResolver do
RSpec.describe Resolvers::TimelogResolver do
include GraphqlHelpers
context "within a group" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::VulnerabilitiesHistoryResolver do
RSpec.describe Resolvers::VulnerabilitiesHistoryResolver do
include GraphqlHelpers
subject { resolve(described_class, obj: group, args: args, ctx: { current_user: user }) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Resolvers::VulnerabilitiesResolver do
RSpec.describe Resolvers::VulnerabilitiesResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['EpicDescendantCount'] do
RSpec.describe GitlabSchema.types['EpicDescendantCount'] do
it { expect(described_class.graphql_name).to eq('EpicDescendantCount') }
it 'has specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['EpicDescendantWeights'] do
RSpec.describe GitlabSchema.types['EpicDescendantWeights'] do
it { expect(described_class.graphql_name).to eq('EpicDescendantWeights') }
it 'has specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['EpicIssue'] do
RSpec.describe GitlabSchema.types['EpicIssue'] do
it { expect(described_class.graphql_name).to eq('EpicIssue') }
it { expect(described_class).to require_graphql_authorizations(:read_issue) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['EpicSort'] do
RSpec.describe GitlabSchema.types['EpicSort'] do
it { expect(described_class.graphql_name).to eq('EpicSort') }
it 'exposes all the existing epic sort orders' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['EpicState'] do
RSpec.describe GitlabSchema.types['EpicState'] do
it { expect(described_class.graphql_name).to eq('EpicState') }
it 'exposes all the existing epic states' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Epic'] do
RSpec.describe GitlabSchema.types['Epic'] do
let(:fields) do
%i[
id iid title description confidential state group parent author labels
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['GeoNode'] do
RSpec.describe GitlabSchema.types['GeoNode'] do
it { expect(described_class).to require_graphql_authorizations(:read_geo_node) }
it 'has the expected fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['PackageFileRegistry'] do
RSpec.describe GitlabSchema.types['PackageFileRegistry'] do
it_behaves_like 'a Geo registry type'
it 'has the expected fields (other than those included in RegistryType)' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['RegistryState'] do
RSpec.describe GitlabSchema.types['RegistryState'] do
it { expect(described_class.graphql_name).to eq('RegistryState') }
it 'exposes the correct registry states' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['HealthStatus'] do
RSpec.describe GitlabSchema.types['HealthStatus'] do
it { expect(described_class.graphql_name).to eq('HealthStatus') }
it 'exposes all the existing epic sort orders' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['InstanceSecurityDashboard'] do
RSpec.describe GitlabSchema.types['InstanceSecurityDashboard'] do
let_it_be(:project) { create(:project) }
let_it_be(:other_project) { create(:project) }
let_it_be(:user) { create(:user, security_dashboard_projects: [project]) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Issue'] do
RSpec.describe GitlabSchema.types['Issue'] do
it { expect(described_class).to have_graphql_field(:epic) }
it { expect(described_class).to have_graphql_field(:iteration) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Iteration'] do
RSpec.describe GitlabSchema.types['Iteration'] do
it { expect(described_class.graphql_name).to eq('Iteration') }
it { expect(described_class).to require_graphql_authorizations(:read_iteration) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['MoveType'] do
RSpec.describe GitlabSchema.types['MoveType'] do
it { expect(described_class.graphql_name).to eq('MoveType') }
it 'exposes all the existing move values' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['PackageTypeEnum'] do
RSpec.describe GitlabSchema.types['PackageTypeEnum'] do
it 'exposes all package types' do
expect(described_class.values.keys).to contain_exactly(*%w[MAVEN NPM CONAN NUGET PYPI COMPOSER])
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Package'] do
RSpec.describe GitlabSchema.types['Package'] do
it { expect(described_class.graphql_name).to eq('Package') }
it 'includes all the package fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::PermissionTypes::Epic do
RSpec.describe Types::PermissionTypes::Epic do
specify do
expected_permissions = [:read_epic, :read_epic_iid, :update_epic, :destroy_epic,
:admin_epic, :create_epic, :create_note, :award_emoji]
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Types::PermissionTypes::Vulnerability do
RSpec.describe Types::PermissionTypes::Vulnerability do
it do
expected_permissions = %i[read_vulnerability_feedback create_vulnerability_feedback destroy_vulnerability_feedback
update_vulnerability_feedback create_vulnerability create_vulnerability_export
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Project'] do
RSpec.describe GitlabSchema.types['Project'] do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:vulnerability) { create(:vulnerability, project: project, severity: :high) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Query'] do
RSpec.describe GitlabSchema.types['Query'] do
specify do
expect(described_class).to have_graphql_fields(
:geo_node,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['RequirementState'] do
RSpec.describe GitlabSchema.types['RequirementState'] do
it { expect(described_class.graphql_name).to eq('RequirementState') }
it 'exposes all the existing requirement states' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['RequirementStatesCount'] do
RSpec.describe GitlabSchema.types['RequirementStatesCount'] do
it { expect(described_class.graphql_name).to eq('RequirementStatesCount') }
it 'has specific fields' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Requirement'] do
RSpec.describe GitlabSchema.types['Requirement'] do
fields = %i[id iid title state project author created_at updated_at user_permissions test_reports]
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Requirement) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['TestReport'] do
RSpec.describe GitlabSchema.types['TestReport'] do
fields = %i[id state pipeline author created_at]
it { expect(described_class.graphql_name).to eq('TestReport') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Timelog'] do
RSpec.describe GitlabSchema.types['Timelog'] do
let(:fields) { %i[date spent_at time_spent user issue] }
it { expect(described_class.graphql_name).to eq('Timelog') }
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilitiesCountByDayAndSeverity'] do
RSpec.describe GitlabSchema.types['VulnerabilitiesCountByDayAndSeverity'] do
it { expect(described_class).to have_graphql_fields(:count, :day, :severity) }
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityLocationContainerScanning'] do
RSpec.describe GitlabSchema.types['VulnerabilityLocationContainerScanning'] do
it { expect(described_class).to have_graphql_fields(:dependency, :image, :operating_system) }
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityLocationDast'] do
RSpec.describe GitlabSchema.types['VulnerabilityLocationDast'] do
it { expect(described_class).to have_graphql_fields(:hostname, :param, :path, :request_method) }
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityLocationDependencyScanning'] do
RSpec.describe GitlabSchema.types['VulnerabilityLocationDependencyScanning'] do
it { expect(described_class).to have_graphql_fields(:dependency, :file) }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityLocationSast'] do
RSpec.describe GitlabSchema.types['VulnerabilityLocationSast'] do
it do
expect(described_class).to have_graphql_fields(
:end_line,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityReportType'] do
RSpec.describe GitlabSchema.types['VulnerabilityReportType'] do
it 'exposes all vulnerability report types' do
expect(described_class.values.keys).to contain_exactly(*%w[SAST SECRET_DETECTION DAST CONTAINER_SCANNING DEPENDENCY_SCANNING])
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilitySeveritiesCount'] do
RSpec.describe GitlabSchema.types['VulnerabilitySeveritiesCount'] do
let_it_be(:fields) do
::Vulnerabilities::Occurrence::SEVERITY_LEVELS.keys
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilitySeverity'] do
RSpec.describe GitlabSchema.types['VulnerabilitySeverity'] do
it 'exposes all vulnerability severities' do
expect(described_class.values.keys).to contain_exactly(*%w[CRITICAL HIGH MEDIUM LOW UNKNOWN INFO])
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerabilityState'] do
RSpec.describe GitlabSchema.types['VulnerabilityState'] do
it 'exposes all vulnerability states' do
expect(described_class.values.keys).to contain_exactly(*%w[DETECTED CONFIRMED DISMISSED RESOLVED])
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSchema.types['Vulnerability'] do
RSpec.describe GitlabSchema.types['Vulnerability'] do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:vulnerability) { create(:vulnerability, project: project) }
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerableDependency'] do
RSpec.describe GitlabSchema.types['VulnerableDependency'] do
it { expect(described_class).to have_graphql_fields(:package, :version) }
end
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe GitlabSchema.types['VulnerablePackage'] do
RSpec.describe GitlabSchema.types['VulnerablePackage'] do
it { expect(described_class).to have_graphql_fields(:name) }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Admin::EmailsHelper, :clean_gitlab_redis_shared_state do
RSpec.describe Admin::EmailsHelper, :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers
let(:lease_key) { Admin::EmailService::LEASE_KEY }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApplicationHelper do
RSpec.describe ApplicationHelper do
include EE::GeoHelpers
describe '#read_only_message', :geo do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuditEventsHelper do
RSpec.describe AuditEventsHelper do
describe '#human_text' do
let(:target_type) { 'User' }
let(:details) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe AuditLogsHelper do
RSpec.describe AuditLogsHelper do
using RSpec::Parameterized::TableSyntax
describe '#admin_audit_log_token_types' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BillingPlansHelper do
RSpec.describe BillingPlansHelper do
describe '#current_plan?' do
it 'returns true when current_plan' do
plan = Hashie::Mash.new(purchase_link: { action: 'current_plan' })
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BoardsHelper do
RSpec.describe BoardsHelper do
let(:project) { create(:project) }
describe '#board_list_data' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ComplianceManagement::ComplianceFramework::ProjectSettingsHelper do
RSpec.describe ComplianceManagement::ComplianceFramework::ProjectSettingsHelper do
describe '#compliance_framework_options' do
it 'has all the options' do
expect(helper.compliance_framework_options).to contain_exactly(
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe CredentialsInventoryHelper do
RSpec.describe CredentialsInventoryHelper do
let(:filter) { nil }
before do
......
......@@ -2,7 +2,7 @@
#
require 'spec_helper'
describe EE::AuthHelper do
RSpec.describe EE::AuthHelper do
describe "button_based_providers" do
it 'excludes group_saml' do
allow(helper).to receive(:auth_providers) { [:group_saml] }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlobHelper do
RSpec.describe BlobHelper do
include TreeHelper
describe '#licenses_for_select' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ClustersHelper do
RSpec.describe ClustersHelper do
shared_examples 'feature availablilty' do |feature|
before do
# clusterable is provided as a `helper_method`
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe DashboardHelper, type: :helper do
RSpec.describe DashboardHelper, type: :helper do
let(:user) { build(:user) }
describe '#dashboard_nav_links' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe EE::EmailsHelper do
RSpec.describe EE::EmailsHelper do
describe '#action_title' do
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EnvironmentsHelper do
RSpec.describe EnvironmentsHelper do
let(:environment) { create(:environment) }
let(:project) { environment.project }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EventsHelper do
RSpec.describe EventsHelper do
describe '#event_note_target_url' do
subject { helper.event_note_target_url(event) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::FlipperSessionHelper do
RSpec.describe EE::FlipperSessionHelper do
describe '.flipper_session' do
let(:session) { {} }
......
# frozen_string_literal: true
require 'spec_helper'
describe EE::GeoHelper do
RSpec.describe EE::GeoHelper do
describe '.current_node_human_status' do
where(:primary, :secondary, :result) do
[
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::GitlabRoutingHelper do
RSpec.describe EE::GitlabRoutingHelper do
include ProjectsHelper
include ApplicationSettingsHelper
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe Groups::GroupMembersHelper do
RSpec.describe Groups::GroupMembersHelper do
describe '.group_member_select_options' do
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupsHelper do
RSpec.describe GroupsHelper do
using RSpec::Parameterized::TableSyntax
let(:owner) { create(:user, group_view: :security_dashboard) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe HooksHelper do
RSpec.describe HooksHelper do
let(:group) { create(:group) }
let(:group_hook) { create(:group_hook, group: group) }
let(:trigger) { 'push_events' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssuablesHelper do
RSpec.describe IssuablesHelper do
let_it_be(:user) { create(:user) }
describe '#issuable_initial_data' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe EE::IssuesHelper do
RSpec.describe EE::IssuesHelper do
let(:project) { create(:project) }
let(:issue) { create :issue, project: project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LabelsHelper do
RSpec.describe LabelsHelper do
let(:project) { create(:project) }
let(:label) { build_stubbed(:label, project: project).present(issuable_subject: nil) }
let(:scoped_label) { build_stubbed(:label, name: 'key::value', project: project).present(issuable_subject: nil) }
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe EE::LockHelper do
RSpec.describe EE::LockHelper do
describe '#lock_file_link' do
let!(:path_lock) { create :path_lock, path: 'app/models' }
let(:path) { path_lock.path }
......
# frozen_string_literal: true
require 'spec_helper'
describe EE::NamespacesHelper do
RSpec.describe EE::NamespacesHelper do
let!(:admin) { create(:admin) }
let!(:admin_project_creation_level) { nil }
let!(:admin_group) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe OnboardingExperimentHelper, type: :helper do
RSpec.describe OnboardingExperimentHelper, type: :helper do
using RSpec::Parameterized::TableSyntax
describe '.allow_access_to_onboarding?' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe OperationsHelper do
RSpec.describe OperationsHelper do
describe '#status_page_settings_data' do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :private) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::PackagesHelper do
RSpec.describe EE::PackagesHelper do
let_it_be(:base_url) { "#{Gitlab.config.gitlab.url}/api/v4/" }
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe RecaptchaExperimentHelper, type: :helper do
RSpec.describe RecaptchaExperimentHelper, type: :helper do
using RSpec::Parameterized::TableSyntax
let(:session) { {} }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::RegistrationsHelper do
RSpec.describe EE::RegistrationsHelper do
using RSpec::Parameterized::TableSyntax
describe '#in_subscription_flow?' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe EE::RunnersHelper do
RSpec.describe EE::RunnersHelper do
let_it_be(:user) { create(:user) }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::ServicesHelper do
RSpec.describe EE::ServicesHelper do
let(:controller_class) do
Class.new(ActionController::Base) do
include EE::ServicesHelper
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SortingHelper do
RSpec.describe SortingHelper do
describe '#sort_direction_icon' do
it 'returns lowest for weight' do
expect(sort_direction_icon('weight')).to eq('sort-lowest')
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ::TodosHelper do
RSpec.describe ::TodosHelper do
describe '#todo_types_options' do
it 'includes options for an epic todo' do
expect(helper.todo_types_options).to include(
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe TreeHelper do
RSpec.describe TreeHelper do
let(:project) { create(:project, :repository) }
describe '#tree_content_data' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::TrialHelper do
RSpec.describe EE::TrialHelper do
using RSpec::Parameterized::TableSyntax
describe '#show_trial_errors?' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe EE::UserCalloutsHelper do
RSpec.describe EE::UserCalloutsHelper do
describe '.render_enable_hashed_storage_warning' do
context 'when we should show the enable warning' do
it 'renders the enable warning' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::VersionCheckHelper do
RSpec.describe EE::VersionCheckHelper do
include StubVersion
describe '#link_to_version' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicsHelper, type: :helper do
RSpec.describe EpicsHelper, type: :helper do
include ApplicationHelper
describe '#epic_endpoint_query_params' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlagsHelper do
RSpec.describe FeatureFlagsHelper do
let_it_be(:project) { create(:project) }
describe '#unleash_api_url' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::SecurityFeaturesHelper do
RSpec.describe Groups::SecurityFeaturesHelper do
using RSpec::Parameterized::TableSyntax
let_it_be(:group, refind: true) { create(:group) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require 'gssapi'
describe KerberosSpnegoHelper do
RSpec.describe KerberosSpnegoHelper do
describe '#spnego_credentials!' do
let(:gss) { double('GSSAPI::Simple') }
let(:gss_service_name) { 'gss_service_name' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LicenseHelper do
RSpec.describe LicenseHelper do
def stub_default_url_options(host: "localhost", protocol: "http", port: nil, script_name: '')
url_options = { host: host, protocol: protocol, port: port, script_name: script_name }
allow(Rails.application.routes).to receive(:default_url_options).and_return(url_options)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LicenseMonitoringHelper do
RSpec.describe LicenseMonitoringHelper do
let_it_be(:admin) { create(:admin) }
let_it_be(:user) { create(:user) }
let_it_be(:license_seats_limit) { 10 }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MarkupHelper do
RSpec.describe MarkupHelper do
let(:project) { create(:project, :public) }
describe '#first_line_in_markdown' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequestsHelper do
RSpec.describe MergeRequestsHelper do
describe '#render_items_list' do
it "returns one item in the list" do
expect(render_items_list(["user"])).to eq("user")
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NotesHelper do
RSpec.describe NotesHelper do
let_it_be(:vulnerability) { create(:vulnerability) }
describe '#notes_url' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PathLocksHelper do
RSpec.describe PathLocksHelper do
describe '#text_label_for_lock' do
it "return correct string for non-nested locks" do
user = create :user, name: 'John'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PersonalAccessTokensHelper do
RSpec.describe PersonalAccessTokensHelper do
let(:group) do
build(:group, max_personal_access_token_lifetime: group_level_max_personal_access_token_lifetime)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PreferencesHelper do
RSpec.describe PreferencesHelper do
before do
allow(helper).to receive(:current_user).and_return(user)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectsHelper do
RSpec.describe ProjectsHelper do
let(:project) { create(:project) }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PushRulesHelper do
RSpec.describe PushRulesHelper do
let(:global_push_rule) { create(:push_rule_sample) }
let(:push_rule) { create(:push_rule) }
let(:admin) { create(:admin) }
......
# frozen_string_literal: true
require 'spec_helper'
describe RoadmapsHelper do
RSpec.describe RoadmapsHelper do
before do
allow(helper).to receive(:current_user) { user }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SearchHelper do
RSpec.describe SearchHelper do
describe '#search_filter_input_options' do
let(:options) { helper.search_filter_input_options(:issues) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SecurityHelper do
RSpec.describe SecurityHelper do
describe '#instance_security_dashboard_data' do
before do
stub_feature_flags(first_class_vulnerabilities: true)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SubscriptionsHelper do
RSpec.describe SubscriptionsHelper do
using RSpec::Parameterized::TableSyntax
let_it_be(:raw_plan_data) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe UsersHelper do
RSpec.describe UsersHelper do
let(:user) { create(:user) }
describe '#current_user_menu_items' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe VulnerabilitiesHelper do
RSpec.describe VulnerabilitiesHelper do
let_it_be(:user) { build(:user) }
let_it_be(:vulnerability) { create(:vulnerability, :with_findings, title: "My vulnerability") }
let_it_be(:project) { vulnerability.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Database config initializer for GitLab EE' do
RSpec.describe 'Database config initializer for GitLab EE' do
subject do
load Rails.root.join('config/initializers/database_config.rb')
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Fog::Storage::GoogleXML::File' do
RSpec.describe 'Fog::Storage::GoogleXML::File' do
let(:storage) do
Fog.mock!
Fog::Storage.new({
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::GroupActivityCalculator do
RSpec.describe Analytics::GroupActivityCalculator do
subject { described_class.new(group, current_user) }
let_it_be(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::MergeRequestMetricsCalculator do
RSpec.describe Analytics::MergeRequestMetricsCalculator do
subject { described_class.new(merge_request) }
let_it_be(:merge_request) { create(:merge_request, :merged, :with_diffs, created_at: 31.days.ago) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::MergeRequestMetricsRefresh do
RSpec.describe Analytics::MergeRequestMetricsRefresh do
subject { calculator_class.new(merge_request) }
let(:calculator_class) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::ProductivityAnalyticsRequestParams do
RSpec.describe Analytics::ProductivityAnalyticsRequestParams do
let(:params) do
{
author_username: 'user',
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::RefreshApprovalsData do
RSpec.describe Analytics::RefreshApprovalsData do
subject { described_class.new(merge_request) }
let(:merge_request) { create :merge_request }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::RefreshCommentsData do
RSpec.describe Analytics::RefreshCommentsData do
describe '.for_note' do
subject { described_class.for_note(note) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Analytics::RefreshReassignData do
RSpec.describe Analytics::RefreshReassignData do
subject { described_class.new(merge_request) }
let(:merge_request) { create :merge_request }
......
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