Commit 20cf0970 authored by Arturo Herrero's avatar Arturo Herrero

RSpec zero monkey patching mode

The plan for RSpec 4.0 is to disable monkey patching:
https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode

This commit stops using RSpec monkey patching:
https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
parent 9ed204a2
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApprovalState do
RSpec.describe ApprovalState do
def create_rule(additional_params = {})
default_approver = create(:user)
params = additional_params.reverse_merge(merge_request: merge_request, users: [default_approver])
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApprovalWrappedAnyApproverRule do
RSpec.describe ApprovalWrappedAnyApproverRule do
let(:merge_request) { create(:merge_request) }
subject { described_class.new(merge_request, rule) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApprovalWrappedCodeOwnerRule do
RSpec.describe ApprovalWrappedCodeOwnerRule do
using RSpec::Parameterized::TableSyntax
let(:merge_request) { create(:merge_request) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApprovalWrappedRule do
RSpec.describe ApprovalWrappedRule do
using RSpec::Parameterized::TableSyntax
let(:merge_request) { create(:merge_request) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApproverGroup do
RSpec.describe ApproverGroup do
subject { create(:approver_group) }
it { is_expected.to be_valid }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BoardAssignee do
RSpec.describe BoardAssignee do
describe 'relationships' do
it { is_expected.to belong_to(:board) }
it { is_expected.to belong_to(:assignee).class_name('User') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BoardLabel do
RSpec.describe BoardLabel do
describe 'validations' do
it { is_expected.to validate_presence_of(:board) }
it { is_expected.to validate_presence_of(:label) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Board do
RSpec.describe Board do
let(:board) { create(:board) }
it { is_expected.to include_module(EE::Board) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe BroadcastMessage do
RSpec.describe BroadcastMessage do
subject { build(:broadcast_message) }
describe '.current', :use_clean_rails_memory_store_caching do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Burndown do
RSpec.describe Burndown do
let_it_be(:user) { create(:user) }
let(:start_date) { "2017-03-01" }
let(:due_date) { "2017-03-03" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Bridge do
RSpec.describe Ci::Bridge do
let_it_be(:project) { create(:project) }
let_it_be(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Build do
RSpec.describe Ci::Build do
let_it_be(:group) { create(:group_with_plan, plan: :bronze_plan) }
let(:project) { create(:project, :repository, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Minutes::Context do
RSpec.describe Ci::Minutes::Context do
let_it_be(:group) { create(:group) }
let(:project) { build(:project, namespace: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Minutes::Notification do
RSpec.describe Ci::Minutes::Notification do
let_it_be(:user) { create(:user) }
let(:shared_runners_enabled) { true }
let!(:project) { create(:project, :repository, namespace: group, shared_runners_enabled: shared_runners_enabled) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Ci::Minutes::Quota do
RSpec.describe Ci::Minutes::Quota do
using RSpec::Parameterized::TableSyntax
let_it_be(:namespace) do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Pipeline do
RSpec.describe Ci::Pipeline do
using RSpec::Parameterized::TableSyntax
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Processable do
RSpec.describe Ci::Processable do
describe 'delegations' do
subject { Ci::Processable.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Sources::Project do
RSpec.describe Ci::Sources::Project do
describe 'Relations' do
it { is_expected.to belong_to(:pipeline).required }
it { is_expected.to belong_to(:source_project).required }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::Subscriptions::Project do
RSpec.describe Ci::Subscriptions::Project do
let(:upstream_project) { create(:project, :public) }
describe 'Relations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Commit do
RSpec.describe Commit do
it_behaves_like 'a mentionable with EE-specific mentions' do
subject { create(:project, :repository).commit }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ComplianceManagement::ComplianceFramework::ProjectSettings do
RSpec.describe ComplianceManagement::ComplianceFramework::ProjectSettings do
let(:known_frameworks) { ComplianceManagement::ComplianceFramework::ProjectSettings.frameworks.keys }
subject { build :compliance_framework_project_setting }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApprovalRuleLike do
RSpec.describe ApprovalRuleLike do
let(:user1) { create(:user) }
let(:user2) { create(:user) }
let(:user3) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ApproverMigrateHook do
RSpec.describe ApproverMigrateHook do
def members(rule)
rule.users.reload + rule.groups.reload
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe DeprecatedApprovalsBeforeMerge do
RSpec.describe DeprecatedApprovalsBeforeMerge do
shared_examples 'with approvals before merge deprecated' do
context 'updating approvals_before_merge' do
it 'creates any_approver rule' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::DeploymentPlatform do
RSpec.describe EE::DeploymentPlatform do
describe '#deployment_platform' do
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Issuable do
RSpec.describe EE::Issuable do
describe "Validation" do
context 'general validations' do
subject { build(:epic) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Mentionable do
RSpec.describe EE::Mentionable do
context Epic do
describe '#store_mentions!' do
it_behaves_like 'mentions in description', :epic
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Milestoneable do
RSpec.describe EE::Milestoneable do
describe '#milestone_available?' do
context 'no Epic' do
let(:issue) { create(:issue) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Noteable do
RSpec.describe EE::Noteable do
subject(:klazz) { Class.new { include Noteable } }
describe '.replyable_types' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::ShaAttribute do
RSpec.describe EE::ShaAttribute do
let(:model) { Class.new { include ShaAttribute } }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::WeightEventable do
RSpec.describe EE::WeightEventable do
subject { build(:issue) }
describe 'associations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Issue, :elastic do
RSpec.describe Issue, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequest, :elastic do
RSpec.describe MergeRequest, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Milestone, :elastic do
RSpec.describe Milestone, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Note, :elastic do
RSpec.describe Note, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Project, :elastic do
RSpec.describe Project, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectWiki, :elastic do
RSpec.describe ProjectWiki, :elastic do
let_it_be(:project) { create(:project, :wiki_repo) }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Repository, :elastic do
RSpec.describe Repository, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Snippet, :elastic do
RSpec.describe Snippet, :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicTreeSorting do
RSpec.describe EpicTreeSorting do
let_it_be(:group) { create(:group) }
let_it_be(:base_epic) { create(:epic, group: group) }
let!(:epic_issue1) { create(:epic_issue, epic: base_epic, relative_position: 10) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe HasTimelogsReport do
RSpec.describe HasTimelogsReport do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:issue) { create(:issue, project: create(:project, :public, group: group)) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ScimPaginatable do
RSpec.describe ScimPaginatable do
let(:paginatable_class) { Identity }
describe 'scim_paginate' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ContainerRegistry::Event do
RSpec.describe ContainerRegistry::Event do
using RSpec::Parameterized::TableSyntax
include ::EE::GeoHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Appearance do
RSpec.describe Appearance do
include ::EE::GeoHelpers
subject { build(:appearance) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Ci::BuildDependencies do
RSpec.describe Ci::BuildDependencies do
describe '#cross_pipeline' do
let_it_be(:user) { create(:user) }
let_it_be(:project, refind: true) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Ci::JobArtifact do
RSpec.describe EE::Ci::JobArtifact do
include EE::GeoHelpers
describe '#destroy' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Ci::Runner do
RSpec.describe EE::Ci::Runner do
describe '#tick_runner_queue' do
it 'sticks the runner to the primary and calls the original method' do
runner = create(:ci_runner)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Clusters::Cluster do
RSpec.describe Clusters::Cluster do
it { is_expected.to include_module(HasEnvironmentScope) }
describe 'validation' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Clusters::Platforms::Kubernetes do
RSpec.describe Clusters::Platforms::Kubernetes do
include KubernetesHelpers
include ReactiveCachingHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe DescriptionVersion do
RSpec.describe DescriptionVersion do
describe 'associations' do
it { is_expected.to belong_to :epic }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Event do
RSpec.describe Event do
describe '#visible_to_user?' do
let_it_be(:non_member) { create(:user) }
let_it_be(:member) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Iteration do
RSpec.describe Iteration do
let_it_be(:project) { create(:project) }
let_it_be(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Label do
RSpec.describe Label do
describe '#scoped_label?' do
context 'with scoped_labels available' do
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe List do
RSpec.describe List do
let(:board) { create(:board) }
describe 'relationships' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::MembersPreloader do
RSpec.describe EE::MembersPreloader do
describe '#preload_all' do
let(:group) { create(:group) }
let(:saml_provider) { create(:saml_provider, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequest::Metrics do
RSpec.describe MergeRequest::Metrics do
describe '#review_start_at' do
it 'is the earliest date from first_comment_at, first_approved_at or first_reassigned_at' do
subject.first_approved_at = 1.hour.ago
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe MergeRequestDiff do
RSpec.describe MergeRequestDiff do
it { is_expected.to respond_to(:log_geo_deleted_event) }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Namespace do
RSpec.describe Namespace do
include EE::GeoHelpers
let(:namespace) { create(:namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NotificationSetting do
RSpec.describe NotificationSetting do
describe '.email_events' do
subject { described_class.email_events(target) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PersonalAccessToken do
RSpec.describe PersonalAccessToken do
describe 'scopes' do
let_it_be(:expired_token) { create(:personal_access_token, expires_at: 1.day.ago) }
let_it_be(:valid_token) { create(:personal_access_token, expires_at: 1.day.from_now) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectAuthorization do
RSpec.describe ProjectAuthorization do
describe '.visible_to_user_and_access_level' do
let(:user) { create(:user) }
let(:project1) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectGroupLink do
RSpec.describe ProjectGroupLink do
describe '#destroy' do
let(:project) { create(:project) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectWiki do
RSpec.describe ProjectWiki do
it_behaves_like 'EE wiki model' do
let(:wiki_container) { create(:project, :wiki_repo, namespace: user.namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProtectedBranch do
RSpec.describe ProtectedBranch do
subject { create(:protected_branch) }
let(:project) { subject.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::ProtectedRefAccess do
RSpec.describe EE::ProtectedRefAccess do
included_in_classes = [ProtectedBranch::MergeAccessLevel,
ProtectedBranch::PushAccessLevel,
ProtectedTag::CreateAccessLevel]
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::ProtectedRef do
RSpec.describe EE::ProtectedRef do
context 'for protected branches' do
it 'deletes all related access levels' do
protected_branch = create(:protected_branch)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::SystemNoteMetadata do
RSpec.describe EE::SystemNoteMetadata do
%i[
vulnerability_confirmed vulnerability_dismissed vulnerability_resolved
].each do |action|
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ElasticsearchIndexedNamespace do
RSpec.describe ElasticsearchIndexedNamespace do
before do
stub_ee_application_setting(elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ElasticsearchIndexedProject do
RSpec.describe ElasticsearchIndexedProject do
before do
stub_ee_application_setting(elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Environment, :use_clean_rails_memory_store_caching do
RSpec.describe Environment, :use_clean_rails_memory_store_caching do
include ReactiveCachingHelpers
let(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicIssue do
RSpec.describe EpicIssue do
describe 'validations' do
let(:epic) { build(:epic) }
let(:confidential_epic) { build(:epic, :confidential) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epic do
RSpec.describe Epic do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicUserMention do
RSpec.describe EpicUserMention do
describe 'associations' do
it { is_expected.to belong_to(:epic) }
it { is_expected.to belong_to(:note) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ContainerRepositoryRegistry, :geo do
RSpec.describe Geo::ContainerRepositoryRegistry, :geo do
it_behaves_like 'a BulkInsertSafe model', Geo::ContainerRepositoryRegistry do
let(:valid_items_for_bulk_insertion) { build_list(:container_repository_registry, 10, created_at: Time.zone.now) }
let(:invalid_items_for_bulk_insertion) { [] } # class does not have any validations defined
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::DesignRegistry, :geo do
RSpec.describe Geo::DesignRegistry, :geo do
it_behaves_like 'a BulkInsertSafe model', Geo::DesignRegistry do
let(:valid_items_for_bulk_insertion) { build_list(:geo_design_registry, 10, created_at: Time.zone.now) }
let(:invalid_items_for_bulk_insertion) { [] } # class does not have any validations defined
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Every Geo event' do
RSpec.describe 'Every Geo event' do
subject { events }
it 'includes Geo::Eventable' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::JobArtifactRegistry, :geo do
RSpec.describe Geo::JobArtifactRegistry, :geo do
include EE::GeoHelpers
it_behaves_like 'a BulkInsertSafe model', Geo::JobArtifactRegistry do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::LfsObjectRegistry, :geo do
RSpec.describe Geo::LfsObjectRegistry, :geo do
describe 'relationships' do
it { is_expected.to belong_to(:lfs_object).class_name('LfsObject') }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::PackageFileRegistry, :geo, type: :model do
RSpec.describe Geo::PackageFileRegistry, :geo, type: :model do
it_behaves_like 'a BulkInsertSafe model', Geo::PackageFileRegistry do
let(:valid_items_for_bulk_insertion) { build_list(:package_file_registry, 10, created_at: Time.zone.now) }
let(:invalid_items_for_bulk_insertion) { [] } # class does not have any validations defined
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ProjectRegistry, :geo_fdw do
RSpec.describe Geo::ProjectRegistry, :geo_fdw do
include ::EE::GeoHelpers
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::PushUser do
RSpec.describe Geo::PushUser do
let!(:user) { create(:user) }
let!(:key) { create(:key, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoriesChangedEvent, type: :model do
RSpec.describe Geo::RepositoriesChangedEvent, type: :model do
describe 'relationships' do
it { is_expected.to belong_to(:geo_node) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryCreatedEvent, type: :model do
RSpec.describe Geo::RepositoryCreatedEvent, type: :model do
describe 'relationships' do
it { is_expected.to belong_to(:project) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::TrackingBase do
RSpec.describe Geo::TrackingBase do
it 'raises when Geo database is not configured' do
allow(Gitlab::Geo).to receive(:geo_database_configured?).and_return(false)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::UploadRegistry, :geo, :geo_fdw do
RSpec.describe Geo::UploadRegistry, :geo, :geo_fdw do
include EE::GeoHelpers
let!(:failed) { create(:geo_upload_registry, :failed) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GeoNodeNamespaceLink, models: true do
RSpec.describe GeoNodeNamespaceLink, models: true do
describe 'relationships' do
it { is_expected.to belong_to(:geo_node) }
it { is_expected.to belong_to(:namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GeoNode, :request_store, :geo, type: :model do
RSpec.describe GeoNode, :request_store, :geo, type: :model do
using RSpec::Parameterized::TableSyntax
include ::EE::GeoHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GeoNodeStatus, :geo, :geo_fdw do
RSpec.describe GeoNodeStatus, :geo, :geo_fdw do
include ::EE::GeoHelpers
let!(:primary) { create(:geo_node, :primary) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::SeatLinkData do
RSpec.describe Gitlab::SeatLinkData do
subject do
described_class.new(
date: date,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSubscription do
RSpec.describe GitlabSubscription do
%i[free_plan bronze_plan silver_plan gold_plan early_adopter_plan].each do |plan|
let_it_be(plan) { create(plan) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupDeletionSchedule do
RSpec.describe GroupDeletionSchedule do
describe 'Associations' do
it { is_expected.to belong_to :group }
it { is_expected.to belong_to(:deleting_user).class_name('User').with_foreign_key('user_id') }
......
# frozen_string_literal: true
require 'spec_helper'
describe GroupMember do
RSpec.describe GroupMember do
it { is_expected.to include_module(EE::GroupMember) }
it_behaves_like 'member validations'
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Group do
RSpec.describe Group do
let(:group) { create(:group) }
it { is_expected.to include_module(EE::Group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupWikiRepository do
RSpec.describe GroupWikiRepository do
describe 'associations' do
it { is_expected.to belong_to(:shard) }
it { is_expected.to belong_to(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupWiki do
RSpec.describe GroupWiki do
it_behaves_like 'wiki model' do
let(:wiki_container) { create(:group, :wiki_repo) }
let(:wiki_container_without_repo) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe HistoricalData do
RSpec.describe HistoricalData do
before do
(1..12).each do |i|
described_class.create!(date: Date.new(2014, i, 1), active_user_count: i * 100)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupHook do
RSpec.describe GroupHook do
describe 'associations' do
it { is_expected.to belong_to :group }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Identity do
RSpec.describe Identity do
describe 'relations' do
it { is_expected.to belong_to(:saml_provider) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe InstanceSecurityDashboard do
RSpec.describe InstanceSecurityDashboard do
let_it_be(:project1) { create(:project) }
let_it_be(:project2) { create(:project) }
let_it_be(:pipeline1) { create(:ci_pipeline, project: project1) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IpRestriction do
RSpec.describe IpRestriction do
describe 'relations' do
it { is_expected.to belong_to(:group) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssuablesAnalytics do
RSpec.describe IssuablesAnalytics do
describe '#data' do
let(:project) { create(:project, :empty_repo) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssueLink do
RSpec.describe IssueLink do
describe 'Associations' do
it { is_expected.to belong_to(:source).class_name('Issue') }
it { is_expected.to belong_to(:target).class_name('Issue') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Issue do
RSpec.describe Issue do
include ExternalAuthorizationServiceHelpers
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe JiraConnectInstallation do
RSpec.describe JiraConnectInstallation do
describe 'associations' do
it { is_expected.to have_many(:subscriptions).class_name('JiraConnectSubscription') }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe JiraConnectSubscription do
RSpec.describe JiraConnectSubscription do
describe 'associations' do
it { is_expected.to belong_to(:installation).class_name('JiraConnectInstallation') }
it { is_expected.to belong_to(:namespace).class_name('Namespace') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LabelNote do
RSpec.describe LabelNote do
include Gitlab::Routing.url_helpers
let_it_be(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LdapGroupLink do
RSpec.describe LdapGroupLink do
let(:klass) { described_class }
let(:ldap_group_link) { build :ldap_group_link }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LfsObject do
RSpec.describe LfsObject do
include EE::GeoHelpers
describe '#destroy' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe License do
RSpec.describe License do
let(:gl_license) { build(:gitlab_license) }
let(:license) { build(:license, data: gl_license.export) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Member, type: :model do
RSpec.describe Member, type: :model do
describe '#notification_service' do
it 'returns a NullNotificationService instance for LDAP users' do
member = described_class.new
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequest do
RSpec.describe MergeRequest do
let(:block) { create(:merge_request_block) }
let(:blocking_mr) { block.blocking_merge_request }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequestBlock do
RSpec.describe MergeRequestBlock do
describe 'associations' do
it { is_expected.to belong_to(:blocking_merge_request).class_name('MergeRequest') }
it { is_expected.to belong_to(:blocked_merge_request).class_name('MergeRequest') }
......
......@@ -7,7 +7,7 @@ require 'spec_helper'
#
# For instance, `ee/spec/models/merge_request/blocking_spec.rb` tests the
# "blocking MRs" feature.
describe MergeRequest do
RSpec.describe MergeRequest do
using RSpec::Parameterized::TableSyntax
include ReactiveCachingHelpers
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe MergeTrain do
RSpec.describe MergeTrain do
include ProjectForksHelper
let_it_be(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Milestone do
RSpec.describe Milestone do
describe "Associations" do
it { is_expected.to have_many(:boards) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NamespaceStatistics do
RSpec.describe NamespaceStatistics do
it { is_expected.to belong_to(:namespace) }
it { is_expected.to validate_presence_of(:namespace) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Note do
RSpec.describe Note do
include ::EE::GeoHelpers
it_behaves_like 'an editable mentionable with EE-specific mentions' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Operations::FeatureFlagScope do
RSpec.describe Operations::FeatureFlagScope do
describe 'associations' do
it { is_expected.to belong_to(:feature_flag) }
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Operations::FeatureFlag do
RSpec.describe Operations::FeatureFlag do
include FeatureFlagHelpers
subject { create(:operations_feature_flag) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Operations::FeatureFlags::Strategy do
RSpec.describe Operations::FeatureFlags::Strategy do
let_it_be(:project) { create(:project) }
describe 'validations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Operations::FeatureFlags::UserList do
RSpec.describe Operations::FeatureFlags::UserList do
subject { create(:operations_feature_flag_user_list) }
describe 'validations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Operations::FeatureFlagsClient do
RSpec.describe Operations::FeatureFlagsClient do
subject { create(:operations_feature_flags_client) }
describe 'associations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::GoModule, type: :model do
RSpec.describe Packages::GoModule, type: :model do
before do
stub_feature_flags(go_proxy_disable_gomod_validation: false)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::GoModuleVersion, type: :model do
RSpec.describe Packages::GoModuleVersion, type: :model do
let_it_be(:user) { create :user }
let_it_be(:project) { create :project_empty_repo, creator: user, path: 'my-go-lib' }
let_it_be(:mod) { create :go_module, project: project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::SemVer, type: :model do
RSpec.describe Packages::SemVer, type: :model do
shared_examples '#parse with a valid semver' do |str, major, minor, patch, prerelease, build|
context "with #{str}" do
it "returns #{described_class.new(major, minor, patch, prerelease, build, prefixed: true)} with prefix" do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PathLock do
RSpec.describe PathLock do
let!(:path_lock) { create(:path_lock, path: 'app/models') }
let(:project) { path_lock.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PgReplicationSlot do
RSpec.describe PgReplicationSlot do
if Gitlab::Database.replication_slots_supported?
describe 'with replication slot support' do
it '#max_replication_slots' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Plan do
RSpec.describe Plan do
describe '#paid?' do
subject { plan.paid? }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProductivityAnalytics do
RSpec.describe ProductivityAnalytics do
describe 'metrics data' do
subject(:analytics) { described_class.new(merge_requests: finder_mrs, sort: custom_sort) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectAlias do
RSpec.describe ProjectAlias do
subject { build(:project_alias) }
it { is_expected.to belong_to(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectCiCdSetting do
RSpec.describe ProjectCiCdSetting do
before do
stub_feature_flags(disable_merge_trains: false)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectFeature do
RSpec.describe ProjectFeature do
let(:project) { create(:project) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectFeatureUsage, type: :model do
RSpec.describe ProjectFeatureUsage, type: :model do
describe '.jira_dvcs_integrations_enabled_count' do
it 'returns count of projects with Jira DVCS Cloud enabled' do
create(:project).feature_usage.log_jira_dvcs_integration_usage
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectImportData do
RSpec.describe ProjectImportData do
using RSpec::Parameterized::TableSyntax
let(:import_url) { 'ssh://example.com' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectImportState, type: :model do
RSpec.describe ProjectImportState, type: :model do
describe 'Project import job' do
let(:project) { import_state.project }
......
# frozen_string_literal: true
require 'spec_helper'
describe ProjectMember do
RSpec.describe ProjectMember do
it { is_expected.to include_module(EE::ProjectMember) }
it_behaves_like 'member validations' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectRepositoryState do
RSpec.describe ProjectRepositoryState do
using RSpec::Parameterized::TableSyntax
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GithubService::RemoteProject do
RSpec.describe GithubService::RemoteProject do
let(:owner) { 'MyUser' }
let(:repository_name) { 'my-project' }
let(:repo_full_path) { "#{owner}/#{repository_name}" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GithubService::StatusMessage do
RSpec.describe GithubService::StatusMessage do
include Rails.application.routes.url_helpers
let(:project) { double(:project, namespace: "me", to_s: 'example_project') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GithubService::StatusNotifier do
RSpec.describe GithubService::StatusNotifier do
let(:access_token) { 'aaaaa' }
let(:repo_path) { 'myself/my-project' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GithubService do
RSpec.describe GithubService do
let(:project) { create(:project) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:pipeline_sample_data) { Gitlab::DataBuilder::Pipeline.build(pipeline) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GitlabSlackApplicationService do
RSpec.describe GitlabSlackApplicationService do
describe '#chat_responder' do
it 'returns the chat responder to use' do
expect(subject.chat_responder).to eq(Gitlab::Chat::Responder::Slack)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe HipchatService do
RSpec.describe HipchatService do
let(:hipchat) { described_class.new }
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe JenkinsService do
RSpec.describe JenkinsService do
let(:project) { create(:project) }
let(:jenkins_url) { 'http://jenkins.example.com/' }
let(:jenkins_hook_url) { jenkins_url + 'project/my_project' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Project do
RSpec.describe Project do
include ProjectForksHelper
include ::EE::GeoHelpers
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe ProjectTeam do
RSpec.describe ProjectTeam do
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ProjectTracingSetting do
RSpec.describe ProjectTracingSetting do
describe '#external_url' do
let_it_be(:project) { create(:project) }
......
......@@ -2,6 +2,6 @@
require 'spec_helper'
describe ProtectedBranch::UnprotectAccessLevel do
RSpec.describe ProtectedBranch::UnprotectAccessLevel do
it { is_expected.to validate_inclusion_of(:access_level).in_array([Gitlab::Access::MAINTAINER, Gitlab::Access::DEVELOPER, Gitlab::Access::NO_ACCESS]) }
end
# frozen_string_literal: true
require 'spec_helper'
describe ProtectedEnvironment::DeployAccessLevel do
RSpec.describe ProtectedEnvironment::DeployAccessLevel do
describe 'associations' do
it { is_expected.to belong_to(:protected_environment) }
it { is_expected.to belong_to(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe ProtectedEnvironment do
RSpec.describe ProtectedEnvironment do
describe 'associations' do
it { is_expected.to belong_to(:project) }
it { is_expected.to have_many(:deploy_access_levels) }
......
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