Commit 5de40069 authored by Markus Koller's avatar Markus Koller

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

RSpec zero monkey patching mode

See merge request gitlab-org/gitlab!33728
parents a62203ed 668a5aca
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe PushRule do RSpec.describe PushRule do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:global_push_rule) { create(:push_rule_sample) } let(:global_push_rule) { create(:push_rule_sample) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RemoteMirror do RSpec.describe RemoteMirror do
let(:project) { create(:project, :repository, :remote_mirror) } let(:project) { create(:project, :repository, :remote_mirror) }
describe '#sync' do describe '#sync' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Repository do RSpec.describe Repository do
include RepoHelpers include RepoHelpers
include ::EE::GeoHelpers include ::EE::GeoHelpers
include GitHelpers include GitHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RequirementsManagement::Requirement do RSpec.describe RequirementsManagement::Requirement do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
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 RequirementsManagement::TestReport do RSpec.describe RequirementsManagement::TestReport do
describe 'associations' do describe 'associations' do
subject { build(:test_report) } subject { build(:test_report) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SamlProvider do RSpec.describe SamlProvider do
let(:group) { create(:group) } let(:group) { create(:group) }
subject(:saml_provider) { create(:saml_provider, group: group) } subject(:saml_provider) { create(:saml_provider, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ScimIdentity do RSpec.describe ScimIdentity do
describe 'relations' do describe 'relations' do
it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:group) }
it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ScimOauthAccessToken do RSpec.describe ScimOauthAccessToken do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :group } it { is_expected.to belong_to :group }
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ScopedLabelSet do RSpec.describe ScopedLabelSet do
let_it_be(:kv_label1) { create(:label, title: 'key::label1') } let_it_be(:kv_label1) { create(:label, title: 'key::label1') }
let_it_be(:kv_label2) { create(:label, title: 'key::label2') } let_it_be(:kv_label2) { create(:label, title: 'key::label2') }
let_it_be(:kv_label3) { create(:label, title: 'key::label3') } let_it_be(:kv_label3) { create(:label, title: 'key::label3') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Security::Scan do RSpec.describe Security::Scan do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:build) } it { is_expected.to belong_to(:build) }
it { is_expected.to have_one(:pipeline).through(:build).class_name('Ci::Pipeline') } it { is_expected.to have_one(:pipeline).through(:build).class_name('Ci::Pipeline') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ServiceDeskSetting do RSpec.describe ServiceDeskSetting do
describe 'validations' do describe 'validations' do
subject(:service_desk_setting) { create(:service_desk_setting) } subject(:service_desk_setting) { create(:service_desk_setting) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Service do RSpec.describe Service do
describe 'Available services' do describe 'Available services' do
let(:ee_services) do let(:ee_services) do
%w( %w(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SlackIntegration do RSpec.describe SlackIntegration do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:service) } it { is_expected.to belong_to(:service) }
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SoftwareLicensePolicy do RSpec.describe SoftwareLicensePolicy do
subject { build(:software_license_policy) } subject { build(:software_license_policy) }
describe 'validations' do describe 'validations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SoftwareLicense do RSpec.describe SoftwareLicense do
subject { build(:software_license) } subject { build(:software_license) }
describe 'validations' do describe 'validations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StatusPage::ProjectSetting do RSpec.describe StatusPage::ProjectSetting do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StatusPage::PublishedIncident do RSpec.describe StatusPage::PublishedIncident do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:issue).inverse_of(:status_page_published_incident) } it { is_expected.to belong_to(:issue).inverse_of(:status_page_published_incident) }
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe StorageShard do RSpec.describe StorageShard do
describe '.all' do describe '.all' do
it 'returns an array of StorageShard objects' do it 'returns an array of StorageShard objects' do
shards = described_class.all shards = described_class.all
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Upload do RSpec.describe Upload do
include EE::GeoHelpers include EE::GeoHelpers
describe '#destroy' do describe '#destroy' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UserPreference do RSpec.describe UserPreference do
let(:user_preference) { create(:user_preference) } let(:user_preference) { create(:user_preference) }
shared_examples 'updates roadmap_epics_state' do |state| shared_examples 'updates roadmap_epics_state' do |state|
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe User do RSpec.describe User do
subject(:user) { described_class.new } subject(:user) { described_class.new }
describe 'user creation' do describe 'user creation' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UsersSecurityDashboardProject do RSpec.describe UsersSecurityDashboardProject do
subject { build(:users_security_dashboard_project) } subject { build(:users_security_dashboard_project) }
describe 'associations' do describe 'associations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VisibleApprovable do RSpec.describe VisibleApprovable do
let(:resource) { create(:merge_request, source_project: project) } let(:resource) { create(:merge_request, source_project: project) }
let!(:project) { create(:project, :repository) } let!(:project) { create(:project, :repository) }
let!(:user) { project.creator } let!(:user) { project.creator }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::Export do RSpec.describe Vulnerabilities::Export do
it { is_expected.to define_enum_for(:format) } it { is_expected.to define_enum_for(:format) }
describe 'associations' do describe 'associations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::Feedback do RSpec.describe Vulnerabilities::Feedback do
it { it {
is_expected.to( is_expected.to(
define_enum_for(:feedback_type) define_enum_for(:feedback_type)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::Identifier do RSpec.describe Vulnerabilities::Identifier do
describe 'associations' do describe 'associations' do
it { is_expected.to have_many(:occurrence_identifiers).class_name('Vulnerabilities::OccurrenceIdentifier') } it { is_expected.to have_many(:occurrence_identifiers).class_name('Vulnerabilities::OccurrenceIdentifier') }
it { is_expected.to have_many(:occurrences).class_name('Vulnerabilities::Occurrence') } it { is_expected.to have_many(:occurrences).class_name('Vulnerabilities::Occurrence') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::IssueLink do RSpec.describe Vulnerabilities::IssueLink do
describe 'associations and fields' do describe 'associations and fields' do
it { is_expected.to belong_to(:vulnerability) } it { is_expected.to belong_to(:vulnerability) }
it { is_expected.to belong_to(:issue) } it { is_expected.to belong_to(:issue) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::OccurrenceIdentifier do RSpec.describe Vulnerabilities::OccurrenceIdentifier do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:identifier).class_name('Vulnerabilities::Identifier') } it { is_expected.to belong_to(:identifier).class_name('Vulnerabilities::Identifier') }
it { is_expected.to belong_to(:occurrence).class_name('Vulnerabilities::Occurrence') } it { is_expected.to belong_to(:occurrence).class_name('Vulnerabilities::Occurrence') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::OccurrencePipeline do RSpec.describe Vulnerabilities::OccurrencePipeline do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:pipeline).class_name('Ci::Pipeline') } it { is_expected.to belong_to(:pipeline).class_name('Ci::Pipeline') }
it { is_expected.to belong_to(:occurrence).class_name('Vulnerabilities::Occurrence') } it { is_expected.to belong_to(:occurrence).class_name('Vulnerabilities::Occurrence') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::Occurrence do RSpec.describe Vulnerabilities::Occurrence do
it { is_expected.to define_enum_for(:confidence) } it { is_expected.to define_enum_for(:confidence) }
it { is_expected.to define_enum_for(:report_type) } it { is_expected.to define_enum_for(:report_type) }
it { is_expected.to define_enum_for(:severity) } it { is_expected.to define_enum_for(:severity) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::Scanner do RSpec.describe Vulnerabilities::Scanner do
describe 'associations' do describe 'associations' do
it { is_expected.to have_many(:occurrences).class_name('Vulnerabilities::Occurrence') } it { is_expected.to have_many(:occurrences).class_name('Vulnerabilities::Occurrence') }
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerability do RSpec.describe Vulnerability do
let(:state_values) { { detected: 1, dismissed: 2, resolved: 3, confirmed: 4 } } let(:state_values) { { detected: 1, dismissed: 2, resolved: 3, confirmed: 4 } }
let(:severity_values) { { info: 1, unknown: 2, low: 4, medium: 5, high: 6, critical: 7 } } let(:severity_values) { { info: 1, unknown: 2, low: 4, medium: 5, high: 6, critical: 7 } }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerabilityUserMention do RSpec.describe VulnerabilityUserMention do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:vulnerability) } it { is_expected.to belong_to(:vulnerability) }
it { is_expected.to belong_to(:note) } it { is_expected.to belong_to(:note) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalMergeRequestRulePolicy do RSpec.describe ApprovalMergeRequestRulePolicy do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
let(:approval_rule) { create(:approval_merge_request_rule, merge_request: merge_request) } let(:approval_rule) { create(:approval_merge_request_rule, merge_request: merge_request) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalProjectRulePolicy do RSpec.describe ApprovalProjectRulePolicy do
let(:project) { create(:project) } let(:project) { create(:project) }
let!(:approval_rule) { create(:approval_project_rule, project: project) } let!(:approval_rule) { create(:approval_project_rule, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AwardEmojiPolicy do RSpec.describe AwardEmojiPolicy do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:award_emoji) { create(:award_emoji, awardable: create(:epic, group: group)) } let(:award_emoji) { create(:award_emoji, awardable: create(:epic, group: group)) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe BasePolicy do RSpec.describe BasePolicy do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
let(:auditor) { build(:auditor) } let(:auditor) { build(:auditor) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Ci::BuildPolicy do RSpec.describe Ci::BuildPolicy do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Clusters::InstancePolicy, :enable_admin_mode do RSpec.describe Clusters::InstancePolicy, :enable_admin_mode do
let(:user) { build(:admin) } let(:user) { build(:admin) }
let(:instance) { Clusters::Instance.new } let(:instance) { Clusters::Instance.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ContainerExpirationPolicyPolicy do RSpec.describe ContainerExpirationPolicyPolicy do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe EnvironmentPolicy do RSpec.describe EnvironmentPolicy do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EpicPolicy do RSpec.describe EpicPolicy do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::RegistryPolicy do RSpec.describe Geo::RegistryPolicy do
let!(:registry) { create(:package_file_registry) } let!(:registry) { create(:package_file_registry) }
subject(:policy) { described_class.new(current_user, registry) } subject(:policy) { described_class.new(current_user, registry) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GeoNodePolicy do RSpec.describe GeoNodePolicy do
let_it_be(:geo_node) { create(:geo_node) } let_it_be(:geo_node) { create(:geo_node) }
subject(:policy) { described_class.new(current_user, geo_node) } subject(:policy) { described_class.new(current_user, geo_node) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GlobalPolicy do RSpec.describe GlobalPolicy do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GroupPolicy do RSpec.describe GroupPolicy do
include_context 'GroupPolicy context' include_context 'GroupPolicy context'
context 'when epics feature is disabled' do context 'when epics feature is disabled' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe IdentityProviderPolicy do RSpec.describe IdentityProviderPolicy do
subject(:policy) { described_class.new(user, :a_provider) } subject(:policy) { described_class.new(user, :a_provider) }
describe '#rules' do describe '#rules' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe InstanceSecurityDashboardPolicy do RSpec.describe InstanceSecurityDashboardPolicy do
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequestPolicy do RSpec.describe MergeRequestPolicy do
include ProjectForksHelper include ProjectForksHelper
let_it_be(:guest) { create(:user) } let_it_be(:guest) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe NamespacePolicy do RSpec.describe NamespacePolicy do
let(:owner) { build_stubbed(:user) } let(:owner) { build_stubbed(:user) }
let(:namespace) { build_stubbed(:namespace, owner: owner) } let(:namespace) { build_stubbed(:namespace, owner: owner) }
let(:owner_permissions) { [:create_projects, :admin_namespace, :read_namespace] } let(:owner_permissions) { [:create_projects, :admin_namespace, :read_namespace] }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe NotePolicy do RSpec.describe NotePolicy do
describe '#rules' do describe '#rules' do
let(:reporter) { create(:user) } let(:reporter) { create(:user) }
let(:developer) { create(:user) } let(:developer) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Packages::PackagePolicy do RSpec.describe Packages::PackagePolicy do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:package) { create(:package, project: project) } let_it_be(:package) { create(:package, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectPolicy do RSpec.describe ProjectPolicy do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
include AdminModeHelper include AdminModeHelper
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
# Snippet visibility scenarios are included in more details in spec/support/snippet_visibility.rb # Snippet visibility scenarios are included in more details in spec/support/snippet_visibility.rb
describe ProjectSnippetPolicy do RSpec.describe ProjectSnippetPolicy do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:snippet) { create(:project_snippet, snippet_visibility, project: project) } let(:snippet) { create(:project_snippet, snippet_visibility, project: project) }
let(:author_permissions) do let(:author_permissions) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProtectedBranchPolicy do RSpec.describe ProtectedBranchPolicy do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:name) { 'feature' } let(:name) { 'feature' }
let(:protected_branch) { create(:protected_branch, name: name) } let(:protected_branch) { create(:protected_branch, name: name) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe RequirementsManagement::RequirementPolicy do RSpec.describe RequirementsManagement::RequirementPolicy do
let_it_be(:owner) { create(:user) } let_it_be(:owner) { create(:user) }
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
let_it_be(:reporter) { create(:user) } let_it_be(:reporter) { create(:user) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe SamlProviderPolicy do RSpec.describe SamlProviderPolicy do
let(:group_visibility) { :public } let(:group_visibility) { :public }
let(:group) { create(:group, group_visibility) } let(:group) { create(:group, group_visibility) }
let(:saml_provider) { create(:saml_provider, group: group) } let(:saml_provider) { create(:saml_provider, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UserPolicy do RSpec.describe UserPolicy do
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::ExportPolicy do RSpec.describe Vulnerabilities::ExportPolicy do
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:project) { create(:project) } let!(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::FeedbackPolicy do RSpec.describe Vulnerabilities::FeedbackPolicy do
include ExternalAuthorizationServiceHelpers include ExternalAuthorizationServiceHelpers
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::IssueLinkPolicy do RSpec.describe Vulnerabilities::IssueLinkPolicy do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, namespace: user.namespace) } let_it_be(:project) { create(:project, namespace: user.namespace) }
let(:vulnerability) { create(:vulnerability, project: project) } let(:vulnerability) { create(:vulnerability, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerabilityPolicy do RSpec.describe VulnerabilityPolicy do
describe 'read_vulnerability' do describe 'read_vulnerability' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Analytics::CycleAnalytics::StagePresenter do RSpec.describe Analytics::CycleAnalytics::StagePresenter do
let(:default_stage_params) { Gitlab::Analytics::CycleAnalytics::DefaultStages.params_for_issue_stage } let(:default_stage_params) { Gitlab::Analytics::CycleAnalytics::DefaultStages.params_for_issue_stage }
let(:default_stage) { Analytics::CycleAnalytics::ProjectStage.new(default_stage_params) } let(:default_stage) { Analytics::CycleAnalytics::ProjectStage.new(default_stage_params) }
let(:custom_stage) { Analytics::CycleAnalytics::ProjectStage.new(name: 'Hello') } let(:custom_stage) { Analytics::CycleAnalytics::ProjectStage.new(name: 'Hello') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRulePresenter do RSpec.describe ApprovalRulePresenter do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:public_group) { create(:group) } let_it_be(:public_group) { create(:group) }
let_it_be(:private_group) { create(:group, :private) } let_it_be(:private_group) { create(:group, :private) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AuditEventPresenter do RSpec.describe AuditEventPresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:details) do let(:details) do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Ci::BuildPresenter do RSpec.describe Ci::BuildPresenter do
subject(:presenter) { described_class.new(build) } subject(:presenter) { described_class.new(build) }
describe '#callout_failure_message' do describe '#callout_failure_message' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::PipelinePresenter do RSpec.describe Ci::PipelinePresenter do
let_it_be(:project, reload: true) { create(:project) } let_it_be(:project, reload: true) { create(:project) }
let_it_be(:pipeline, reload: true) { create(:ee_ci_pipeline, project: project) } let_it_be(:pipeline, reload: true) { create(:ee_ci_pipeline, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Clusters::ClusterPresenter do RSpec.describe Clusters::ClusterPresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
describe '#health_data' do describe '#health_data' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe InstanceClusterablePresenter do RSpec.describe InstanceClusterablePresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:presenter) { described_class.new(instance) } let(:presenter) { described_class.new(instance) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EpicIssuePresenter do RSpec.describe EpicIssuePresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EpicPresenter do RSpec.describe EpicPresenter do
include UsersHelper include UsersHelper
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GroupClusterablePresenter do RSpec.describe GroupClusterablePresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
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 GroupMemberPresenter do RSpec.describe GroupMemberPresenter do
let(:user) { double(:user) } let(:user) { double(:user) }
let(:group) { double(:group) } let(:group) { double(:group) }
let(:group_member) { double(:group_member, source: group, user: user) } let(:group_member) { double(:group_member, source: group, user: user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe LabelPresenter do RSpec.describe LabelPresenter do
let(:project) { create(:project) } let(:project) { create(:project) }
describe '#scoped_label?' do describe '#scoped_label?' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequestApproverPresenter do RSpec.describe MergeRequestApproverPresenter do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request, target_project: project, source_project: project) }
let(:file_paths) { %w{readme.md} } let(:file_paths) { %w{readme.md} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequestPresenter do RSpec.describe MergeRequestPresenter do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Packages::Conan::PackagePresenter do RSpec.describe ::Packages::Conan::PackagePresenter do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:conan_package_reference) { '123456789'} let_it_be(:conan_package_reference) { '123456789'}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Packages::Detail::PackagePresenter do RSpec.describe ::Packages::Detail::PackagePresenter do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, creator: user) } let_it_be(:project) { create(:project, creator: user) }
let_it_be(:package) { create(:npm_package, :with_build, project: project) } let_it_be(:package) { create(:npm_package, :with_build, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Packages::Npm::PackagePresenter do RSpec.describe ::Packages::Npm::PackagePresenter do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:package_name) { "@#{project.root_namespace.path}/test" } let_it_be(:package_name) { "@#{project.root_namespace.path}/test" }
let!(:package1) { create(:npm_package, version: '1.0.4', project: project, name: package_name) } let!(:package1) { create(:npm_package, version: '1.0.4', project: project, name: package_name) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Packages::Nuget::PackageMetadataPresenter do RSpec.describe Packages::Nuget::PackageMetadataPresenter do
let_it_be(:package) { create(:nuget_package, :with_metadatum) } let_it_be(:package) { create(:nuget_package, :with_metadatum) }
let_it_be(:tag1) { create(:packages_tag, name: 'tag1', package: package) } let_it_be(:tag1) { create(:packages_tag, name: 'tag1', package: package) }
let_it_be(:tag2) { create(:packages_tag, name: 'tag2', package: package) } let_it_be(:tag2) { create(:packages_tag, name: 'tag2', package: package) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Packages::Nuget::PackagesMetadataPresenter do RSpec.describe Packages::Nuget::PackagesMetadataPresenter do
let_it_be(:packages) { create_list(:nuget_package, 5, :with_metadatum, name: 'Dummy.Package') } let_it_be(:packages) { create_list(:nuget_package, 5, :with_metadatum, name: 'Dummy.Package') }
let_it_be(:presenter) { described_class.new(packages) } let_it_be(:presenter) { described_class.new(packages) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Packages::Nuget::PackagesVersionsPresenter do RSpec.describe Packages::Nuget::PackagesVersionsPresenter do
let_it_be(:packages) { create_list(:nuget_package, 5) } let_it_be(:packages) { create_list(:nuget_package, 5) }
let_it_be(:presenter) { described_class.new(::Packages::Package.all) } let_it_be(:presenter) { described_class.new(::Packages::Package.all) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Packages::Nuget::SearchResultsPresenter do RSpec.describe Packages::Nuget::SearchResultsPresenter do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:package_a) { create(:nuget_package, :with_metadatum, project: project, name: 'DummyPackageA') } let_it_be(:package_a) { create(:nuget_package, :with_metadatum, project: project, name: 'DummyPackageA') }
let_it_be(:tag1) { create(:packages_tag, package: package_a, name: 'tag1') } let_it_be(:tag1) { create(:packages_tag, package: package_a, name: 'tag1') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Packages::Nuget::ServiceIndexPresenter do RSpec.describe ::Packages::Nuget::ServiceIndexPresenter do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:presenter) { described_class.new(project) } let_it_be(:presenter) { described_class.new(project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Packages::Pypi::PackagePresenter do RSpec.describe ::Packages::Pypi::PackagePresenter do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
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 ProjectClusterablePresenter do RSpec.describe ProjectClusterablePresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:presenter) { described_class.new(project) } let(:presenter) { described_class.new(project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectMemberPresenter do RSpec.describe ProjectMemberPresenter do
let(:user) { double(:user) } let(:user) { double(:user) }
let(:project) { double(:project) } let(:project) { double(:project) }
let(:project_member) { double(:project_member, source: project) } let(:project_member) { double(:project_member, source: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectPresenter do RSpec.describe ProjectPresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Projects::Security::ConfigurationPresenter do RSpec.describe Projects::Security::ConfigurationPresenter do
include Gitlab::Routing.url_helpers include Gitlab::Routing.url_helpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Security::VulnerableProjectPresenter do RSpec.describe Security::VulnerableProjectPresenter do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe SubscriptionPresenter do RSpec.describe SubscriptionPresenter do
let(:subscription) { create(:gitlab_subscription) } let(:subscription) { create(:gitlab_subscription) }
let(:presenter) { described_class.new(subscription, {}) } let(:presenter) { described_class.new(subscription, {}) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::OccurrencePresenter do RSpec.describe Vulnerabilities::OccurrencePresenter do
let(:presenter) { described_class.new(occurrence) } let(:presenter) { described_class.new(occurrence) }
let(:occurrence) { build_stubbed(:vulnerabilities_occurrence) } let(:occurrence) { build_stubbed(:vulnerabilities_occurrence) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Geo::PackageFileReplicator do RSpec.describe Geo::PackageFileReplicator do
let(:model_record) { build(:package_file, :npm) } let(:model_record) { build(:package_file, :npm) }
it_behaves_like 'a blob replicator' it_behaves_like 'a blob replicator'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'view audit events' do RSpec.describe 'view audit events' do
describe 'GET /audit_events' do describe 'GET /audit_events' do
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
let_it_be(:audit_event) { create(:user_audit_event) } let_it_be(:audit_event) { create(:user_audit_event) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe API::Analytics::CodeReviewAnalytics do RSpec.describe API::Analytics::CodeReviewAnalytics do
let_it_be(:group) { create(:group, :private) } let_it_be(:group) { create(:group, :private) }
let_it_be(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
let(:current_user) { reporter } let(:current_user) { reporter }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe API::Analytics::GroupActivityAnalytics do RSpec.describe API::Analytics::GroupActivityAnalytics do
let_it_be(:group) { create(:group, :private) } let_it_be(:group) { create(:group, :private) }
let_it_be(:reporter) do let_it_be(:reporter) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe API::AuditEvents do RSpec.describe API::AuditEvents do
describe 'GET /audit_events' do describe 'GET /audit_events' do
let(:url) { "/audit_events" } let(:url) { "/audit_events" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe API::Boards do RSpec.describe API::Boards do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:board_parent) { create(:project, :public, creator_id: user.id, namespace: user.namespace ) } let_it_be(:board_parent) { create(:project, :public, creator_id: user.id, namespace: user.namespace ) }
let_it_be(:milestone) { create(:milestone, project: board_parent) } let_it_be(:milestone) { create(:milestone, project: board_parent) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe API::Branches do RSpec.describe API::Branches do
describe 'PUT /projects/:id/repository/branches/:branch/protect' do describe 'PUT /projects/:id/repository/branches/:branch/protect' do
context 'when authenticated', 'as a maintainer' do context 'when authenticated', 'as a maintainer' do
let(:user) { create(:user) } let(:user) { create(:user) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe API::ComposerPackages do RSpec.describe API::ComposerPackages do
include EE::PackagesManagerApiSpecHelpers include EE::PackagesManagerApiSpecHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
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.
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