Commit 46f5d7e4 authored by Stan Hu's avatar Stan Hu

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

RSpec zero monkey patching mode

See merge request gitlab-org/gitlab!33731
parents ab880c6a 41c4c289
# frozen_string_literal: true
require 'spec_helper'
describe Users::UpdateService do
RSpec.describe Users::UpdateService do
let(:user) { create(:user) }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe VulnerabilityFeedbackModule::UpdateService, '#execute' do
RSpec.describe VulnerabilityFeedbackModule::UpdateService, '#execute' do
let(:group) { create(:group) }
let(:project) { create(:project, :public, :repository, namespace: group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::IndexProjectsByIdService do
RSpec.describe Elastic::IndexProjectsByIdService do
describe '#execute' do
it 'schedules index workers' do
Sidekiq::Testing.fake! do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::IndexProjectsByRangeService do
RSpec.describe Elastic::IndexProjectsByRangeService do
describe '#execute' do
context 'when without project' do
it 'does not err' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::IndexProjectsService do
RSpec.describe Elastic::IndexProjectsService do
describe '#execute' do
context 'when elasticsearch_limit_indexing? is true' do
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::IndexRecordService, :elastic do
RSpec.describe Elastic::IndexRecordService, :elastic do
subject { described_class.new }
# Create admin user and search globally to avoid dealing with permissions in
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::IndexingControlService, :clean_gitlab_redis_shared_state do
RSpec.describe Elastic::IndexingControlService, :clean_gitlab_redis_shared_state do
let(:worker_class) do
Class.new do
def self.name
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::MetricsUpdateService, :prometheus do
RSpec.describe Elastic::MetricsUpdateService, :prometheus do
subject { described_class.new }
before do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Elastic::ProcessBookkeepingService, :clean_gitlab_redis_shared_state do
RSpec.describe Elastic::ProcessBookkeepingService, :clean_gitlab_redis_shared_state do
around do |example|
described_class.with_redis do |redis|
@redis = redis
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Emails::CreateService do
RSpec.describe Emails::CreateService do
let(:user) { create(:user) }
let(:opts) { { email: 'new@email.com', user: user } }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Emails::DestroyService do
RSpec.describe Emails::DestroyService do
let!(:user) { create(:user) }
let!(:email) { create(:email, user: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicIssues::CreateService do
RSpec.describe EpicIssues::CreateService do
describe '#execute' do
let(:group) { create(:group) }
let(:epic) { create(:epic, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicIssues::DestroyService do
RSpec.describe EpicIssues::DestroyService do
describe '#execute' do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicIssues::ListService do
RSpec.describe EpicIssues::ListService do
let(:user) { create :user }
let(:group) { create(:group, :private) }
let(:project) { create(:project_empty_repo, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicIssues::UpdateService do
RSpec.describe EpicIssues::UpdateService do
describe '#execute' do
let(:user) { create(:user) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicLinks::CreateService do
RSpec.describe EpicLinks::CreateService do
describe '#execute' do
let(:group) { create(:group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicLinks::DestroyService do
RSpec.describe EpicLinks::DestroyService do
describe '#execute' do
let(:group) { create(:group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicLinks::ListService do
RSpec.describe EpicLinks::ListService do
let(:user) { create :user }
let(:group) { create(:group, :public) }
let(:parent_epic) { create(:epic, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EpicLinks::UpdateService do
RSpec.describe EpicLinks::UpdateService do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:parent_epic) { create(:epic, group: group) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Epics::CloseService do
RSpec.describe Epics::CloseService do
let(:group) { create(:group, :internal) }
let(:user) { create(:user) }
let(:epic) { create(:epic, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epics::CreateService do
RSpec.describe Epics::CreateService do
let_it_be(:group) { create(:group, :internal)}
let_it_be(:user) { create(:user) }
let_it_be(:parent_epic) { create(:epic, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epics::DescendantCountService do
RSpec.describe Epics::DescendantCountService do
let_it_be(:group) { create(:group, :public)}
let_it_be(:subgroup) { create(:group, :private, parent: group)}
let_it_be(:user) { create(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Epics::IssuePromoteService do
RSpec.describe Epics::IssuePromoteService do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Epics::ReopenService do
RSpec.describe Epics::ReopenService do
let(:group) { create(:group, :internal) }
let(:user) { create(:user) }
let(:epic) { create(:epic, group: group, state: :closed, closed_at: Date.today, closed_by: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epics::TreeReorderService do
RSpec.describe Epics::TreeReorderService do
describe '#execute' do
let(:user) { create(:user) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epics::UpdateDatesService do
RSpec.describe Epics::UpdateDatesService do
let(:group) { create(:group, :internal) }
let(:user) { create(:user) }
let(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Epics::UpdateService do
RSpec.describe Epics::UpdateService do
let(:group) { create(:group, :internal) }
let(:user) { create(:user) }
let(:epic) { create(:epic, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlags::CreateService do
RSpec.describe FeatureFlags::CreateService do
let(:project) { create(:project) }
let(:developer) { create(:user) }
let(:reporter) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlags::DestroyService do
RSpec.describe FeatureFlags::DestroyService do
include FeatureFlagHelpers
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlags::DisableService do
RSpec.describe FeatureFlags::DisableService do
include FeatureFlagHelpers
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlags::EnableService do
RSpec.describe FeatureFlags::EnableService do
include FeatureFlagHelpers
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FeatureFlags::UpdateService do
RSpec.describe FeatureFlags::UpdateService do
let(:project) { create(:project) }
let(:developer) { create(:user) }
let(:reporter) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe FetchSubscriptionPlansService do
RSpec.describe FetchSubscriptionPlansService do
describe '#execute' do
let(:endpoint_url) { 'https://customers.gitlab.com/gitlab_plans' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::BaseFileService do
RSpec.describe Geo::BaseFileService do
subject { described_class.new('file', 8) }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe Geo::BlobDownloadService do
RSpec.describe Geo::BlobDownloadService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::BlobUploadService do
RSpec.describe Geo::BlobUploadService do
let(:package_file) { create(:package_file, :npm) }
subject { described_class.new(replicable_name: 'package_file', replicable_id: package_file.id, decoded_params: {}) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::BlobVerificationSecondaryService, :geo do
RSpec.describe Geo::BlobVerificationSecondaryService, :geo do
include ::EE::GeoHelpers
let(:secondary) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::CacheInvalidationEventStore do
RSpec.describe Geo::CacheInvalidationEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ContainerRepositorySyncService, :geo do
RSpec.describe Geo::ContainerRepositorySyncService, :geo do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ContainerRepositorySync, :geo do
RSpec.describe Geo::ContainerRepositorySync, :geo do
let(:group) { create(:group, name: 'group') }
let(:project) { create(:project, path: 'test', group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ContainerRepositoryUpdatedEventStore do
RSpec.describe Geo::ContainerRepositoryUpdatedEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::DesignRepositorySyncService do
RSpec.describe Geo::DesignRepositorySyncService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::EventService do
RSpec.describe Geo::EventService do
include ::EE::GeoHelpers
let_it_be(:primary) { create(:geo_node, :primary) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::FileDownloadService do
RSpec.describe Geo::FileDownloadService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::FileRegistryRemovalService, :geo do
RSpec.describe Geo::FileRegistryRemovalService, :geo do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::FileUploadService do
RSpec.describe Geo::FileUploadService do
include EE::GeoHelpers
let_it_be(:node) { create(:geo_node, :primary) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::FilesExpireService, :geo, :geo_fdw do
RSpec.describe Geo::FilesExpireService, :geo, :geo_fdw do
let(:project) { create(:project, :legacy_storage) }
let!(:old_full_path) { project.full_path }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::HashedStorageAttachmentsEventStore do
RSpec.describe Geo::HashedStorageAttachmentsEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -6,7 +6,7 @@ def base_path(storage)
File.join(FileUploader.root, storage.disk_path)
end
describe Geo::HashedStorageAttachmentsMigrationService do
RSpec.describe Geo::HashedStorageAttachmentsMigrationService do
let!(:project) { create(:project, :legacy_storage) }
let(:legacy_storage) { Storage::LegacyProject.new(project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::HashedStorageMigratedEventStore do
RSpec.describe Geo::HashedStorageMigratedEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::HashedStorageMigrationService do
RSpec.describe Geo::HashedStorageMigrationService do
let!(:project) { create(:project, :repository, :legacy_storage) }
let(:old_path) { project.full_path }
let(:new_path) { "#{old_path}+renamed" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::JobArtifactDeletedEventStore do
RSpec.describe Geo::JobArtifactDeletedEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::LfsObjectDeletedEventStore do
RSpec.describe Geo::LfsObjectDeletedEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::MetricsUpdateService, :geo, :prometheus do
RSpec.describe Geo::MetricsUpdateService, :geo, :prometheus do
include ::EE::GeoHelpers
let_it_be(:primary) { create(:geo_node, :primary) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::MoveRepositoryService, :geo do
RSpec.describe Geo::MoveRepositoryService, :geo do
describe '#execute' do
let(:project) { create(:project, :repository, :wiki_repo, :legacy_storage) }
let(:old_path) { project.full_path }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::NodeCreateService do
RSpec.describe Geo::NodeCreateService do
describe '#execute' do
it 'creates a new node with valid params' do
service = described_class.new(name: 'foo', url: 'http://example.com')
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::NodeStatusPostService, :geo do
RSpec.describe Geo::NodeStatusPostService, :geo do
include ::EE::GeoHelpers
include ApiHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::NodeUpdateService do
RSpec.describe Geo::NodeUpdateService do
include EE::GeoHelpers
let_it_be(:primary, reload: true) { create(:geo_node, :primary) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ProjectHousekeepingService do
RSpec.describe Geo::ProjectHousekeepingService do
include ExclusiveLeaseHelpers
include ::EE::GeoHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::PruneEventLogService do
RSpec.describe Geo::PruneEventLogService do
include ExclusiveLeaseHelpers
let(:min_id) { :all }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RegistryConsistencyService, :geo, :use_clean_rails_memory_store_caching do
RSpec.describe Geo::RegistryConsistencyService, :geo, :use_clean_rails_memory_store_caching do
include EE::GeoHelpers
let(:secondary) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RenameRepositoryService do
RSpec.describe Geo::RenameRepositoryService do
let(:project) { create(:project, :repository, :legacy_storage) }
let(:old_path) { project.full_path }
let(:new_path) { "#{old_path}+renamed" }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoriesChangedEventStore do
RSpec.describe Geo::RepositoriesChangedEventStore do
include EE::GeoHelpers
let(:geo_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryBaseSyncService do
RSpec.describe Geo::RepositoryBaseSyncService do
let(:project) { build('project') }
subject { described_class.new(project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryCreatedEventStore do
RSpec.describe Geo::RepositoryCreatedEventStore do
include EE::GeoHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryDeletedEventStore do
RSpec.describe Geo::RepositoryDeletedEventStore do
include EE::GeoHelpers
let_it_be(:project) { create(:project, path: 'bar') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryDestroyService do
RSpec.describe Geo::RepositoryDestroyService do
include ::EE::GeoHelpers
let_it_be(:secondary) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryRenamedEventStore do
RSpec.describe Geo::RepositoryRenamedEventStore do
include EE::GeoHelpers
let_it_be(:project) { create(:project, path: 'bar') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositorySyncService do
RSpec.describe Geo::RepositorySyncService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryUpdatedEventStore do
RSpec.describe Geo::RepositoryUpdatedEventStore do
include EE::GeoHelpers
let_it_be(:project) { create(:project, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryUpdatedService do
RSpec.describe Geo::RepositoryUpdatedService do
include ::EE::GeoHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryVerificationPrimaryService do
RSpec.describe Geo::RepositoryVerificationPrimaryService do
include EE::GeoHelpers
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryVerificationReset, :geo do
RSpec.describe Geo::RepositoryVerificationReset, :geo do
include ::EE::GeoHelpers
let(:secondary) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::RepositoryVerificationSecondaryService, :geo do
RSpec.describe Geo::RepositoryVerificationSecondaryService, :geo do
include ::EE::GeoHelpers
shared_examples 'verify checksums for repositories/wikis' do |type|
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::ResetChecksumEventStore do
RSpec.describe Geo::ResetChecksumEventStore do
include EE::GeoHelpers
let_it_be(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Geo::UploadDeletedEventStore do
RSpec.describe Geo::UploadDeletedEventStore do
include EE::GeoHelpers
let_it_be(:secondary_node) { create(:geo_node) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::GroupManagedAccounts::CleanUpMembersService do
RSpec.describe GroupSaml::GroupManagedAccounts::CleanUpMembersService do
subject(:service) { described_class.new(current_user, group) }
let(:group) { Group.new }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::GroupManagedAccounts::TransferMembershipService do
RSpec.describe GroupSaml::GroupManagedAccounts::TransferMembershipService do
subject(:service) { described_class.new(current_user, group, session) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::Identity::DestroyService do
RSpec.describe GroupSaml::Identity::DestroyService do
let(:identity) { create(:group_saml_identity) }
subject { described_class.new(identity) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::SamlProvider::CreateService do
RSpec.describe GroupSaml::SamlProvider::CreateService do
let(:current_user) { build_stubbed(:user) }
subject(:service) { described_class.new(current_user, group, params: params) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::SamlProvider::UpdateService do
RSpec.describe GroupSaml::SamlProvider::UpdateService do
let(:current_user) { create(:user) }
subject(:service) { described_class.new(current_user, saml_provider, params: params) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe GroupSaml::SignUpService do
RSpec.describe GroupSaml::SignUpService do
subject(:service) { described_class.new(new_user, group, session) }
let(:new_user) { build(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::AutocompleteService do
RSpec.describe Groups::AutocompleteService do
let!(:group) { create(:group, :nested, :private, avatar: fixture_file_upload('spec/fixtures/dk.png')) }
let!(:sub_group) { create(:group, :private, parent: group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::CreateService, '#execute' do
RSpec.describe Groups::CreateService, '#execute' do
let!(:user) { create :user }
let!(:group_params) do
{
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::DestroyService do
RSpec.describe Groups::DestroyService do
let!(:user) { create(:user) }
let!(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::MarkForDeletionService do
RSpec.describe Groups::MarkForDeletionService do
let(:user) { create(:user) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::ParticipantsService do
RSpec.describe Groups::ParticipantsService do
let(:group) { create(:group, avatar: fixture_file_upload('spec/fixtures/dk.png')) }
let(:user) { create(:user) }
let(:epic) { create(:epic, group: group, author: user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::RestoreService do
RSpec.describe Groups::RestoreService do
let(:user) { create(:user) }
let(:group) do
create(:group_with_deletion_schedule,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::TransferService, '#execute' do
RSpec.describe Groups::TransferService, '#execute' do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:project) { create(:project, :public, namespace: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Groups::UpdateService, '#execute' do
RSpec.describe Groups::UpdateService, '#execute' do
let!(:user) { create(:user) }
let!(:group) { create(:group, :public) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssueLinks::CreateService do
RSpec.describe IssueLinks::CreateService do
describe '#execute' do
let(:namespace) { create :namespace }
let(:project) { create :project, namespace: namespace }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssueLinks::DestroyService do
RSpec.describe IssueLinks::DestroyService do
describe '#execute' do
let(:project) { create(:project) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe IssueLinks::ListService do
RSpec.describe IssueLinks::ListService do
let(:user) { create :user }
let(:project) { create(:project_empty_repo, :private) }
let(:issue) { create :issue, project: project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Issues::BuildService do
RSpec.describe Issues::BuildService do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Issues::DuplicateService do
RSpec.describe Issues::DuplicateService do
let(:user) { create(:user) }
let(:canonical_project) { create(:project) }
let(:duplicate_project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Issues::ExportCsvService do
RSpec.describe Issues::ExportCsvService do
let_it_be(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, :public, group: group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Iterations::CreateService do
RSpec.describe Iterations::CreateService do
shared_examples 'iterations create service' do
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe JiraConnect::SyncService do
RSpec.describe JiraConnect::SyncService do
describe '#execute' do
let_it_be(:project) { create(:project, :repository) }
let(:branches) { [project.repository.find_branch('master')] }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe JiraConnectSubscriptions::CreateService do
RSpec.describe JiraConnectSubscriptions::CreateService do
let(:installation) { create(:jira_connect_installation) }
let(:current_user) { create(:user) }
let(:group) { create(:group) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Keys::CreateService do
RSpec.describe Keys::CreateService do
let(:user) { create(:user) }
let(:params) { attributes_for(:key) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Keys::LastUsedService do
RSpec.describe Keys::LastUsedService do
it 'does not run on read-only GitLab instances', :clean_gitlab_redis_shared_state do
key = create(:key, last_used_at: 1.year.ago)
original_time = key.last_used_at
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe LdapGroupResetService do
RSpec.describe LdapGroupResetService do
# TODO: refactor to multi-ldap setup
let(:group) { create(:group) }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Lfs::LockFileService do
RSpec.describe Lfs::LockFileService do
let(:project) { create(:project) }
let(:current_user) { create(:user) }
let(:params) { { path: 'README.md' } }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Lfs::UnlockFileService do
RSpec.describe Lfs::UnlockFileService do
let(:project) { create(:project) }
let(:lock_author) { create(:user) }
let!(:lock) { create(:lfs_file_lock, user: lock_author, project: project) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Licenses::DestroyService do
RSpec.describe Licenses::DestroyService do
let(:license) { create(:license) }
let_it_be(:user) { create(:admin) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::ApprovalService do
RSpec.describe MergeRequests::ApprovalService do
describe '#execute' do
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::BuildService do
RSpec.describe MergeRequests::BuildService do
let(:source_project) { project }
let(:target_project) { project }
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::MergeService do
RSpec.describe MergeRequests::MergeService do
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request, :simple) }
let(:project) { merge_request.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::MergeToRefService do
RSpec.describe MergeRequests::MergeToRefService do
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request, :simple) }
let(:project) { merge_request.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::RemoveApprovalService do
RSpec.describe MergeRequests::RemoveApprovalService do
describe '#execute' do
let(:user) { create(:user) }
let(:project) { create(:project, approvals_before_merge: 1) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::SyncCodeOwnerApprovalRules do
RSpec.describe MergeRequests::SyncCodeOwnerApprovalRules do
let(:merge_request) { create(:merge_request) }
let(:rb_owners) { create_list(:user, 2) }
let(:doc_owners) { create_list(:user, 2) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::SyncReportApproverApprovalRules do
RSpec.describe MergeRequests::SyncReportApproverApprovalRules do
subject(:service) { described_class.new(merge_request) }
let(:merge_request) { create(:merge_request) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeRequests::UpdateBlocksService do
RSpec.describe MergeRequests::UpdateBlocksService do
describe '.extract_params!' do
it 'removes and reformats merge request params' do
mr_params = {
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeTrains::CheckStatusService do
RSpec.describe MergeTrains::CheckStatusService do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:maintainer) { create(:user).tap { |u| project.add_maintainer(u)} }
let(:service) { described_class.new(project, maintainer) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeTrains::CreatePipelineService do
RSpec.describe MergeTrains::CreatePipelineService do
let(:project) { create(:project, :repository, :auto_devops) }
let_it_be(:maintainer) { create(:user) }
let(:service) { described_class.new(project, maintainer) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeTrains::RefreshMergeRequestService do
RSpec.describe MergeTrains::RefreshMergeRequestService do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:maintainer) { create(:user) }
let(:service) { described_class.new(project, maintainer, require_recreate: require_recreate) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe MergeTrains::RefreshMergeRequestsService do
RSpec.describe MergeTrains::RefreshMergeRequestsService do
include ExclusiveLeaseHelpers
let(:project) { create(:project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Metrics::Dashboard::CloneDashboardService, :use_clean_rails_memory_store_caching do
RSpec.describe Metrics::Dashboard::CloneDashboardService, :use_clean_rails_memory_store_caching do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:environment) { create(:environment, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Metrics::Dashboard::ClusterDashboardService, :use_clean_rails_memory_store_caching do
RSpec.describe Metrics::Dashboard::ClusterDashboardService, :use_clean_rails_memory_store_caching do
include MetricsDashboardHelpers
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Metrics::Dashboard::ClusterMetricsEmbedService, :use_clean_rails_memory_store_caching do
RSpec.describe Metrics::Dashboard::ClusterMetricsEmbedService, :use_clean_rails_memory_store_caching do
include MetricsDashboardHelpers
using RSpec::Parameterized::TableSyntax
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Milestones::PromoteService do
RSpec.describe Milestones::PromoteService do
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
let(:user) { create(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Milestones::UpdateService do
RSpec.describe Milestones::UpdateService do
describe '#execute' do
context 'refresh related epic dates' do
it 'updates milestone sourced dates' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NetworkPolicies::DeleteResourceService do
RSpec.describe NetworkPolicies::DeleteResourceService do
let(:service) { NetworkPolicies::DeleteResourceService.new(resource_name: 'policy', environment: environment) }
let(:environment) { instance_double('Environment', deployment_platform: platform, deployment_namespace: 'namespace') }
let(:platform) { instance_double('Clusters::Platforms::Kubernetes', kubeclient: kubeclient) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NetworkPolicies::DeployResourceService do
RSpec.describe NetworkPolicies::DeployResourceService do
let(:service) { NetworkPolicies::DeployResourceService.new(policy: policy, environment: environment) }
let(:environment) { instance_double('Environment', deployment_platform: platform, deployment_namespace: 'namespace') }
let(:platform) { instance_double('Clusters::Platforms::Kubernetes', kubeclient: kubeclient) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe NetworkPolicies::ResourcesService do
RSpec.describe NetworkPolicies::ResourcesService do
let(:service) { NetworkPolicies::ResourcesService.new(environment: environment) }
let(:environment) { instance_double('Environment', deployment_platform: platform, deployment_namespace: 'namespace') }
let(:platform) { instance_double('Clusters::Platforms::Kubernetes', kubeclient: kubeclient) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Conan::CreatePackageFileService do
RSpec.describe Packages::Conan::CreatePackageFileService do
include WorkhorseHelpers
let_it_be(:package) { create(:conan_package) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Conan::CreatePackageService do
RSpec.describe Packages::Conan::CreatePackageService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::Conan::SearchService do
RSpec.describe Packages::Conan::SearchService do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :public) }
let!(:conan_package) { create(:conan_package, project: project) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::CreateDependencyService do
RSpec.describe Packages::CreateDependencyService do
describe '#execute' do
let_it_be(:namespace) {create(:namespace)}
let_it_be(:version) { '1.0.1' }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::CreatePackageFileService do
RSpec.describe Packages::CreatePackageFileService do
let(:package) { create(:maven_package) }
describe '#execute' do
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Maven::CreatePackageService do
RSpec.describe Packages::Maven::CreatePackageService do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:app_name) { 'my-app' }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Maven::FindOrCreatePackageService do
RSpec.describe Packages::Maven::FindOrCreatePackageService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:app_name) { 'my-app' }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Npm::CreatePackageService do
RSpec.describe Packages::Npm::CreatePackageService do
let(:namespace) {create(:namespace)}
let(:project) { create(:project, namespace: namespace) }
let(:user) { create(:user) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Npm::CreateTagService do
RSpec.describe Packages::Npm::CreateTagService do
let(:package) { create(:npm_package) }
let(:tag_name) { 'test-tag' }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Nuget::CreateDependencyService do
RSpec.describe Packages::Nuget::CreateDependencyService do
let_it_be(:package, reload: true) { create(:nuget_package) }
describe '#execute' do
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Nuget::CreatePackageService do
RSpec.describe Packages::Nuget::CreatePackageService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:params) { {} }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::Nuget::MetadataExtractionService do
RSpec.describe Packages::Nuget::MetadataExtractionService do
let(:package_file) { create(:nuget_package).package_files.first }
let(:service) { described_class.new(package_file.id) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Nuget::SearchService do
RSpec.describe Packages::Nuget::SearchService do
let_it_be(:project) { create(:project) }
let_it_be(:package_a) { create(:nuget_package, project: project, name: 'DummyPackageA') }
let_it_be(:packages_b) { create_list(:nuget_package, 5, project: project, name: 'DummyPackageB') }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::Nuget::SyncMetadatumService do
RSpec.describe Packages::Nuget::SyncMetadatumService do
let_it_be(:package, reload: true) { create(:nuget_package) }
let_it_be(:metadata) do
{
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Packages::Nuget::UpdatePackageFromMetadataService, :clean_gitlab_redis_shared_state do
RSpec.describe Packages::Nuget::UpdatePackageFromMetadataService, :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers
let(:package) { create(:nuget_package) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::Pypi::CreatePackageService do
RSpec.describe Packages::Pypi::CreatePackageService do
include EE::PackagesManagerApiSpecHelpers
let_it_be(:project) { create(:project) }
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::RemoveTagService do
RSpec.describe Packages::RemoveTagService do
let!(:package_tag) { create(:packages_tag) }
describe '#execute' do
......
# frozen_string_literal: true
require 'spec_helper'
describe Packages::UpdateTagsService do
RSpec.describe Packages::UpdateTagsService do
let_it_be(:package, reload: true) { create(:nuget_package) }
let(:tags) { %w(test-tag tag1 tag2 tag3) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PathLocks::LockService do
RSpec.describe PathLocks::LockService do
let(:current_user) { create(:user) }
let(:project) { create(:project) }
let(:path) { 'app/models' }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PathLocks::UnlockService do
RSpec.describe PathLocks::UnlockService do
let(:path_lock) { create :path_lock }
let(:current_user) { path_lock.user }
let(:project) { path_lock.project }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PersonalAccessTokens::Groups::UpdateLifetimeService do
RSpec.describe PersonalAccessTokens::Groups::UpdateLifetimeService do
include ExclusiveLeaseHelpers
describe '#execute', :clean_gitlab_redis_shared_state do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PersonalAccessTokens::Instance::UpdateLifetimeService do
RSpec.describe PersonalAccessTokens::Instance::UpdateLifetimeService do
describe '#execute', :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe PersonalAccessTokens::RevokeInvalidTokens do
RSpec.describe PersonalAccessTokens::RevokeInvalidTokens do
subject(:service) { described_class.new(user, expiration_date) }
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::AfterRenameService do
RSpec.describe Projects::AfterRenameService do
include EE::GeoHelpers
describe '#execute' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::CleanupService do
RSpec.describe Projects::CleanupService do
include ::EE::GeoHelpers
let(:project) { create(:project, :repository, bfg_object_map: fixture_file_upload('spec/fixtures/bfg_object_map.txt')) }
......
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