Commit 49bef37b authored by Robert Speicher's avatar Robert Speicher

Merge branch 'replace-set-with-let-it-be-in-ee-specs-batch-3' into 'master'

Replace set with let_it_be in EE specs (batch 3)

See merge request gitlab-org/gitlab!23018
parents 253be692 e4e8f18c
......@@ -15,8 +15,8 @@ describe ContainerRegistry::EventHandler do
{ 'tag' => 'latest', 'repository' => container_repository.path }
end
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
before do
stub_current_geo_node(primary_node)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe EE::API::Entities::DesignManagement::Design do
set(:design) { create(:design) }
let_it_be(:design) { create(:design) }
let(:entity) { described_class.new(design, request: double) }
subject { entity.as_json }
......
......@@ -3,10 +3,10 @@
require 'spec_helper'
describe API::Helpers::IssuesHelpers do
set(:group) { create(:group) }
set(:project) { create(:project, group: group) }
set(:user) { create(:user) }
set(:epic) { create(:epic, group: group) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:user) { create(:user) }
let_it_be(:epic) { create(:epic, group: group) }
subject(:issues_helpers) { Class.new.include(described_class).new }
......
......@@ -4,10 +4,10 @@ require 'spec_helper'
describe EventFilter do
describe '#apply_filter' do
set(:group) { create(:group, :public) }
set(:project) { create(:project, :public) }
set(:epic_event) { create(:event, :created, group: group, target: create(:epic, group: group)) }
set(:issue_event) { create(:event, :created, project: project, target: create(:issue, project: project)) }
let_it_be(:group) { create(:group, :public) }
let_it_be(:project) { create(:project, :public) }
let_it_be(:epic_event) { create(:event, :created, group: group, target: create(:epic, group: group)) }
let_it_be(:issue_event) { create(:event, :created, project: project, target: create(:issue, project: project)) }
let(:filtered_events) { described_class.new(filter).apply_filter(Event.all) }
context 'with the "epic" filter' do
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Validate::Abilities do
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:pipeline) do
build_stubbed(:ci_pipeline, project: project)
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::Activity do
set(:namespace) { create(:namespace) }
set(:project) { create(:project, namespace: namespace) }
set(:gold_plan) { create(:gold_plan) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
......
......@@ -3,10 +3,10 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::JobActivity do
let_it_be(:namespace, refind: true) { create(:namespace) }
let_it_be(:project, refind: true) { create(:project, namespace: namespace) }
set(:gold_plan) { create(:gold_plan) }
set(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
subject { described_class.new(namespace, project) }
......
......@@ -3,10 +3,10 @@
require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::Size do
set(:namespace) { create(:namespace) }
set(:gold_plan) { create(:gold_plan) }
set(:project) { create(:project, :repository, namespace: namespace) }
set(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let(:pipeline) { build_stubbed(:ci_pipeline, project: project) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::HookData::IssueBuilder do
set(:issue) { create(:issue) }
let_it_be(:issue) { create(:issue) }
let(:builder) { described_class.new(issue) }
describe '#build' do
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Gitlab::Alerting::Alert do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:alert) { build(:alerting_alert, project: project, payload: payload) }
let(:payload) { {} }
......
......@@ -9,7 +9,7 @@ describe Gitlab::Checks::DiffCheck do
describe '#validate!' do
context 'no push rules active' do
set(:push_rule) { create(:push_rule) }
let_it_be(:push_rule) { create(:push_rule) }
it "does not attempt to check commits" do
expect(subject).not_to receive(:process_commits)
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity do
set(:namespace) { create(:namespace) }
set(:project) { create(:project, namespace: namespace) }
set(:user) { create(:user) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project) { create(:project, namespace: namespace) }
let_it_be(:user) { create(:user) }
let(:command) do
double('command', project: project, current_user: user)
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::JobActivity do
set(:namespace) { create(:namespace) }
set(:project) { create(:project, namespace: namespace) }
set(:user) { create(:user) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project) { create(:project, namespace: namespace) }
let_it_be(:user) { create(:user) }
let(:command) do
double('command', project: project, current_user: user)
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe ::Gitlab::Ci::Pipeline::Chain::Limit::Size do
set(:namespace) { create(:namespace) }
set(:project) { create(:project, :repository, namespace: namespace) }
set(:user) { create(:user) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:user) { create(:user) }
let(:pipeline) { build(:ci_pipeline, project: project) }
......
......@@ -4,8 +4,8 @@ require 'spec_helper'
describe Gitlab::CodeOwners::Loader do
include FakeBlobHelpers
set(:group) { create(:group) }
set(:project) { create(:project, namespace: group) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
subject(:loader) { described_class.new(project, 'with-codeowners', paths) }
let(:codeowner_content) do
......
......@@ -5,10 +5,10 @@ require 'spec_helper'
describe Gitlab::CustomFileTemplates do
using RSpec::Parameterized::TableSyntax
set(:instance_template_project) { create(:project, :custom_repo, files: template_files('instance')) }
set(:group) { create(:group) }
set(:project) { create(:project, namespace: group) }
set(:group_template_project) { create(:project, :custom_repo, namespace: group, files: template_files('group')) }
let_it_be(:instance_template_project) { create(:project, :custom_repo, files: template_files('instance')) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
let_it_be(:group_template_project) { create(:project, :custom_repo, namespace: group, files: template_files('group')) }
subject(:templates) { described_class.new(template_finder, target_project) }
......@@ -86,9 +86,9 @@ describe Gitlab::CustomFileTemplates do
end
context 'in a subgroup' do
set(:subgroup) { create(:group, parent: group) }
set(:subproject) { create(:project, namespace: subgroup) }
set(:subgroup_template_project) { create(:project, :custom_repo, namespace: subgroup, files: template_files('subgroup')) }
let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:subproject) { create(:project, namespace: subgroup) }
let_it_be(:subgroup_template_project) { create(:project, :custom_repo, namespace: subgroup, files: template_files('subgroup')) }
let(:target_project) { subproject }
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe Gitlab::Elastic::GroupSearchResults do
set(:user) { create(:user) }
set(:group) { create(:group) }
set(:guest) { create(:user).tap { |u| group.add_user(u, Gitlab::Access::GUEST) } }
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:guest) { create(:user).tap { |u| group.add_user(u, Gitlab::Access::GUEST) } }
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
......
......@@ -12,8 +12,8 @@ describe Gitlab::Geo::CronManager, :geo do
subject(:manager) { described_class.new }
describe '#execute' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
def init_cron_job(job_name, class_name)
job = Sidekiq::Cron::Job.new(
......
......@@ -9,7 +9,8 @@ describe Gitlab::Geo::GitPushHttp, :geo, :use_clean_rails_memory_store_caching d
let(:gl_repository) { 'project-77777' }
let(:cache_key) { "#{described_class::CACHE_KEY_PREFIX}:#{gl_id}:#{gl_repository}" }
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
subject { described_class.new(gl_id, gl_repository) }
describe '#cache_referrer_node' do
......
......@@ -7,8 +7,8 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
# TODO This spec doesn't work with a relative_url_root https://gitlab.com/gitlab-org/gitlab/issues/11173
# TODO This spec doesn't work with non-localhost
set(:primary_node) { create(:geo_node, :primary, url: 'http://localhost:3001') }
set(:secondary_node) { create(:geo_node, url: 'http://localhost:3002') }
let_it_be(:primary_node) { create(:geo_node, :primary, url: 'http://localhost:3001') }
let_it_be(:secondary_node) { create(:geo_node, url: 'http://localhost:3002') }
let(:current_node) { nil }
let(:project) { create(:project, :repository) }
......
......@@ -6,7 +6,7 @@ describe Gitlab::Geo::HealthCheck, :geo do
include ::EE::GeoHelpers
using RSpec::Parameterized::TableSyntax
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
describe '#perform_checks' do
before do
......
......@@ -6,9 +6,8 @@ describe Gitlab::Geo::LogCursor::Daemon, :clean_gitlab_redis_shared_state do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary, reload: true) { create(:geo_node, :primary) }
let_it_be(:secondary, reload: true) { create(:geo_node) }
let(:options) { {} }
subject(:daemon) { described_class.new(options) }
......@@ -268,7 +267,7 @@ describe Gitlab::Geo::LogCursor::Daemon, :clean_gitlab_redis_shared_state do
end
describe '#handle_single_event' do
set(:event_log) { create(:geo_event_log, :updated_event) }
let_it_be(:event_log) { create(:geo_event_log, :updated_event) }
it 'skips execution when no event data is found' do
event_log = build(:geo_event_log)
......
......@@ -6,7 +6,7 @@ describe Gitlab::Geo::LogCursor::Events::RepositoriesChangedEvent, :clean_gitlab
include ::EE::GeoHelpers
let(:logger) { Gitlab::Geo::LogCursor::Logger.new(described_class, Logger::INFO) }
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
let(:repositories_changed_event) { create(:geo_repositories_changed_event, geo_node: secondary) }
let(:event_log) { create(:geo_event_log, repositories_changed_event: repositories_changed_event) }
let!(:event_log_state) { create(:geo_event_log_state, event_id: event_log.id - 1) }
......
......@@ -6,7 +6,7 @@ describe Gitlab::Geo::LogCursor::Events::RepositoryUpdatedEvent, :clean_gitlab_r
include ::EE::GeoHelpers
let(:logger) { Gitlab::Geo::LogCursor::Logger.new(described_class, Logger::INFO) }
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
let(:project) { create(:project) }
let(:repository_updated_event) { create(:geo_repository_updated_event, project: project) }
let(:event_log) { create(:geo_event_log, repository_updated_event: repository_updated_event) }
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::BaseTransfer do
include ::EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
describe '#can_transfer?' do
subject do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::FileDownloader, :geo do
include EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
subject { downloader.execute }
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::FileTransfer do
include ::EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:user) { create(:user, :with_avatar) }
let(:upload) { Upload.find_by(model: user, uploader: 'AvatarUploader') }
......
......@@ -5,9 +5,9 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::JobArtifactTransfer, :geo do
include ::EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
set(:job_artifact) { create(:ci_job_artifact, :archive, :correct_checksum) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
let_it_be(:job_artifact) { create(:ci_job_artifact, :archive, :correct_checksum) }
subject do
described_class.new(job_artifact)
......
......@@ -5,9 +5,9 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::LfsTransfer do
include ::EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
set(:lfs_object) { create(:lfs_object, :with_file, :correct_oid) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
let_it_be(:lfs_object) { create(:lfs_object, :with_file, :correct_oid) }
subject do
described_class.new(lfs_object)
......
......@@ -6,8 +6,8 @@ describe Gitlab::Geo, :geo, :request_store do
using RSpec::Parameterized::TableSyntax
include ::EE::GeoHelpers
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
shared_examples 'a Geo cached value' do |method, key|
it 'includes GitLab version and Rails.version in the cache key' do
......
......@@ -4,8 +4,8 @@ require 'spec_helper'
describe Gitlab::GitAccessDesign do
include DesignManagementTestHelpers
set(:project) { create(:project) }
set(:user) { project.owner }
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let(:protocol) { 'web' }
let(:actor) { user }
......@@ -25,7 +25,7 @@ describe Gitlab::GitAccessDesign do
end
context "when the user is not allowed to manage designs" do
set(:user) { create(:user) }
let_it_be(:user) { create(:user) }
it "raises an error " do
expect { subject }.to raise_error(::Gitlab::GitAccess::UnauthorizedError)
......
......@@ -6,7 +6,7 @@ describe Gitlab::GitAccess do
include GitHelpers
include EE::GeoHelpers
set(:user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:actor) { user }
let(:project) { create(:project, :repository) }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::GlRepository do
describe '.parse' do
set(:project) { create(:project, :repository) }
let_it_be(:project) { create(:project, :repository) }
it 'parses a design gl_repository' do
expect(described_class.parse("design-#{project.id}")).to eq([project, EE::Gitlab::GlRepository::DESIGN])
......
......@@ -4,8 +4,8 @@ require 'spec_helper'
describe Gitlab::ImportExport::DesignRepoSaver do
describe 'bundle a design Git repo' do
set(:user) { create(:user) }
set(:design) { create(:design, :with_file, versions_count: 1) }
let_it_be(:user) { create(:user) }
let_it_be(:design) { create(:design, :with_file, versions_count: 1) }
let!(:project) { create(:project, :design_repo) }
let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
let(:shared) { project.import_export_shared }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Alerting::ProjectAlertingSetting do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
subject { create(:project_alerting_setting, project: project) }
......
......@@ -267,14 +267,14 @@ describe ApplicationSetting do
where(indexing: [true, false], searching: [true, false], limiting: [true, false])
with_them do
set(:included_project_container) { create(:elasticsearch_indexed_project) }
set(:included_namespace_container) { create(:elasticsearch_indexed_namespace) }
let_it_be(:included_project_container) { create(:elasticsearch_indexed_project) }
let_it_be(:included_namespace_container) { create(:elasticsearch_indexed_namespace) }
set(:included_project) { included_project_container.project }
set(:included_namespace) { included_namespace_container.namespace }
let_it_be(:included_project) { included_project_container.project }
let_it_be(:included_namespace) { included_namespace_container.namespace }
set(:excluded_project) { create(:project) }
set(:excluded_namespace) { create(:namespace) }
let_it_be(:excluded_project) { create(:project) }
let_it_be(:excluded_namespace) { create(:namespace) }
let(:only_when_enabled_globally) { indexing && searching && !limiting }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Burndown do
set(:user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:start_date) { "2017-03-01" }
let(:due_date) { "2017-03-03" }
......@@ -35,7 +35,7 @@ describe Burndown do
end
context 'when issues belong to a public project' do
set(:non_member) { create(:user) }
let_it_be(:non_member) { create(:user) }
subject do
project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe Ci::Bridge do
set(:project) { create(:project) }
set(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) }
set(:pipeline) { create(:ci_pipeline, project: project) }
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) }
let(:bridge) do
create(:ci_bridge, :variables, status: :created,
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Ci::Build do
set(:group) { create(:group, plan: :bronze_plan) }
let_it_be(:group) { create(:group, plan: :bronze_plan) }
let(:project) { create(:project, :repository, group: group) }
let(:pipeline) do
......
......@@ -6,8 +6,8 @@ describe Ci::JobArtifact do
include EE::GeoHelpers
describe '#destroy' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
it 'creates a JobArtifactDeletedEvent' do
stub_current_geo_node(primary)
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe Ci::Pipeline do
let(:user) { create(:user) }
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:pipeline) do
create(:ci_empty_pipeline, status: :created, project: project)
......
......@@ -11,8 +11,8 @@ describe Issue, :elastic do
let(:admin) { create :user, :admin }
context 'when limited indexing is on' do
set(:project) { create :project, name: 'test1' }
set(:issue) { create :issue, project: project}
let_it_be(:project) { create :project, name: 'test1' }
let_it_be(:issue) { create :issue, project: project}
before do
stub_ee_application_setting(elasticsearch_limit_indexing: true)
......@@ -39,7 +39,7 @@ describe Issue, :elastic do
end
context 'when a group is enabled' do
set(:group) { create(:group) }
let_it_be(:group) { create(:group) }
before do
create :elasticsearch_indexed_namespace, namespace: group
......
......@@ -10,8 +10,8 @@ describe MergeRequest, :elastic do
let(:admin) { create(:user, :admin) }
it_behaves_like 'limited indexing is enabled' do
set(:object) { create :merge_request, source_project: project }
set(:group) { create(:group) }
let_it_be(:object) { create :merge_request, source_project: project }
let_it_be(:group) { create(:group) }
let(:group_object) do
project = create :project, name: 'test1', group: group
create :merge_request, source_project: project
......
......@@ -8,8 +8,8 @@ describe Milestone, :elastic do
end
it_behaves_like 'limited indexing is enabled' do
set(:object) { create :milestone, project: project }
set(:group) { create(:group) }
let_it_be(:object) { create :milestone, project: project }
let_it_be(:group) { create(:group) }
let(:group_object) do
project = create :project, name: 'test1', group: group
create :milestone, project: project
......
......@@ -8,8 +8,8 @@ describe Note, :elastic do
end
it_behaves_like 'limited indexing is enabled' do
set(:object) { create :note, project: project }
set(:group) { create(:group) }
let_it_be(:object) { create :note, project: project }
let_it_be(:group) { create(:group) }
let(:group_object) do
project = create :project, name: 'test1', group: group
create :note, project: project
......
......@@ -8,7 +8,7 @@ describe Project, :elastic do
end
context 'when limited indexing is on' do
set(:project) { create :project, name: 'test1' }
let_it_be(:project) { create :project, name: 'test1' }
before do
stub_ee_application_setting(elasticsearch_limit_indexing: true)
......@@ -62,7 +62,7 @@ describe Project, :elastic do
end
context 'when a group is enabled' do
set(:group) { create(:group) }
let_it_be(:group) { create(:group) }
before do
create :elasticsearch_indexed_namespace, namespace: group
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe ProjectWiki, :elastic do
set(:project) { create(:project, :wiki_repo) }
let_it_be(:project) { create(:project, :wiki_repo) }
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
......
......@@ -9,9 +9,9 @@ describe DesignManagement::Action do
describe 'scopes' do
describe '.most_recent' do
set(:design_a) { create(:design) }
set(:design_b) { create(:design) }
set(:design_c) { create(:design) }
let_it_be(:design_a) { create(:design) }
let_it_be(:design_b) { create(:design) }
let_it_be(:design_c) { create(:design) }
let(:designs) { [design_a, design_b, design_c] }
......@@ -35,15 +35,15 @@ describe DesignManagement::Action do
end
describe '.up_to_version' do
set(:issue) { create(:issue) }
set(:design_a) { create(:design, issue: issue) }
set(:design_b) { create(:design, issue: issue) }
let_it_be(:issue) { create(:issue) }
let_it_be(:design_a) { create(:design, issue: issue) }
let_it_be(:design_b) { create(:design, issue: issue) }
# let bindings are not available in before(:all) contexts,
# so we need to redefine the array on each construction.
set(:oldest) { create(:design_version, designs: [design_a, design_b]) }
set(:middle) { create(:design_version, designs: [design_a, design_b]) }
set(:newest) { create(:design_version, designs: [design_a, design_b]) }
let_it_be(:oldest) { create(:design_version, designs: [design_a, design_b]) }
let_it_be(:middle) { create(:design_version, designs: [design_a, design_b]) }
let_it_be(:newest) { create(:design_version, designs: [design_a, design_b]) }
subject { described_class.where(design: issue.designs).up_to_version(version) }
......
......@@ -5,10 +5,10 @@ require 'spec_helper'
describe DesignManagement::DesignAtVersion do
include DesignManagementTestHelpers
set(:issue) { create(:issue) }
set(:issue_b) { create(:issue) }
set(:design) { create(:design, issue: issue) }
set(:version) { create(:design_version, designs: [design]) }
let_it_be(:issue, reload: true) { create(:issue) }
let_it_be(:issue_b, reload: true) { create(:issue) }
let_it_be(:design, reload: true) { create(:design, issue: issue) }
let_it_be(:version) { create(:design_version, designs: [design]) }
describe '#id' do
subject { described_class.new(design: design, version: version) }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe DesignManagement::DesignCollection do
include DesignManagementTestHelpers
set(:issue) { create(:issue) }
let_it_be(:issue, reload: true) { create(:issue) }
subject(:collection) { described_class.new(issue) }
......
......@@ -391,7 +391,7 @@ describe DesignManagement::Design do
end
describe '#user_notes_count', :use_clean_rails_memory_store_caching do
set(:design) { create(:design, :with_file) }
let_it_be(:design) { create(:design, :with_file) }
subject { design.user_notes_count }
......
......@@ -24,8 +24,8 @@ describe Appearance do
context 'object storage with background upload' do
context 'when running in a Geo primary node' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
before do
stub_current_geo_node(primary)
......
......@@ -4,11 +4,11 @@ require 'spec_helper'
describe Event do
describe '#visible_to_user?' do
set(:non_member) { create(:user) }
set(:member) { create(:user) }
set(:guest) { create(:user) }
set(:author) { create(:author) }
set(:admin) { create(:admin) }
let_it_be(:non_member) { create(:user) }
let_it_be(:member) { create(:user) }
let_it_be(:guest) { create(:user) }
let_it_be(:author) { create(:author) }
let_it_be(:admin) { create(:admin) }
let(:epic) { create(:epic, group: group, author: author) }
let(:note_on_epic) { create(:note, :on_epic, noteable: epic) }
let(:event) { described_class.new(group: group, target: target, author: author) }
......
......@@ -59,8 +59,8 @@ describe Note do
end
context 'when running in a Geo primary node' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
before do
stub_current_geo_node(primary)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Geo::ContainerRepositoryRegistry, :geo do
set(:registry) { create(:container_repository_registry) }
let_it_be(:registry) { create(:container_repository_registry) }
describe 'relationships' do
it { is_expected.to belong_to(:container_repository) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe IncidentManagement::ProjectIncidentManagementSetting do
set(:project) { create(:project, :repository, create_templates: :issue) }
let_it_be(:project) { create(:project, :repository, create_templates: :issue) }
describe 'Associations' do
it { is_expected.to belong_to(:project) }
......
......@@ -9,7 +9,7 @@ describe Issue do
context 'callbacks' do
describe '.after_create' do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:author) { User.alert_bot }
context 'when issue title is "New: Incident"' do
......
......@@ -5,12 +5,12 @@ require 'spec_helper'
describe LabelNote do
include Gitlab::Routing.url_helpers
set(:group) { create(:group) }
set(:user) { create(:user) }
set(:label) { create(:group_label, group: group) }
set(:label2) { create(:group_label, group: group) }
let_it_be(:group) { create(:group) }
let_it_be(:user) { create(:user) }
let_it_be(:label) { create(:group_label, group: group) }
let_it_be(:label2) { create(:group_label, group: group) }
let(:resource_parent) { group }
set(:resource) { create(:epic, group: group) }
let_it_be(:resource) { create(:epic, group: group) }
let(:project) { nil }
let(:resource_key) { resource.class.name.underscore.to_s }
let(:events) { [create(:resource_label_event, label: label, resource_key => resource)] }
......
......@@ -9,8 +9,8 @@ describe LfsObject do
subject { create(:lfs_object, :with_file) }
context 'when running in a Geo primary node' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
it 'logs an event to the Geo event log' do
stub_current_geo_node(primary)
......
......@@ -5,7 +5,7 @@ require "spec_helper"
describe MergeTrain do
include ProjectForksHelper
set(:project) { create(:project, :repository) }
let_it_be(:project) { create(:project, :repository) }
it { is_expected.to belong_to(:merge_request) }
it { is_expected.to belong_to(:user) }
......
......@@ -139,7 +139,7 @@ describe Namespace do
end
context 'when group is subgroup' do
set(:root_ancestor) { create(:group) }
let_it_be(:root_ancestor) { create(:group) }
let(:namespace) { create(:namespace, parent: root_ancestor) }
it 'is invalid' do
......@@ -159,8 +159,8 @@ describe Namespace do
describe '#move_dir' do
context 'when running on a primary node' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
let(:gitlab_shell) { Gitlab::Shell.new }
let(:parent_group) { create(:group) }
let(:child_group) { create(:group, name: 'child', path: 'child', parent: parent_group) }
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
describe ProjectRepositoryState do
using RSpec::Parameterized::TableSyntax
set(:project) { create(:project) }
set(:repository_state) { create(:repository_state, project_id: project.id) }
let_it_be(:project) { create(:project) }
let_it_be(:repository_state) { create(:repository_state, project_id: project.id) }
subject { repository_state }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe AlertsService do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:service_params) { { project: project, active: active } }
let(:active) { true }
let(:service) { described_class.new(service_params) }
......
......@@ -423,7 +423,7 @@ describe Project do
end
describe '#environments_for_scope' do
set(:project) { create(:project) }
let_it_be(:project, reload: true) { create(:project) }
before do
create_list(:environment, 2, project: project)
......@@ -784,8 +784,8 @@ describe Project do
end
describe '#shared_runners_limit_namespace' do
set(:root_ancestor) { create(:group) }
set(:group) { create(:group, parent: root_ancestor) }
let_it_be(:root_ancestor) { create(:group) }
let_it_be(:group) { create(:group, parent: root_ancestor) }
let(:project) { create(:project, namespace: group) }
subject { project.shared_runners_limit_namespace }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe ProjectTracingSetting do
describe '#external_url' do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:tracing_setting) { project.build_tracing_setting }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe PrometheusAlert do
set(:project) { build(:project) }
let_it_be(:project) { build(:project) }
let(:metric) { build(:prometheus_metric) }
describe '.distinct_projects' do
......
......@@ -9,8 +9,8 @@ describe Repository do
TestBlob = Struct.new(:path)
set(:primary_node) { create(:geo_node, :primary) }
set(:secondary_node) { create(:geo_node) }
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe ScopedLabelSet do
set(:kv_label1) { create(:label, title: 'key::label1') }
set(:kv_label2) { create(:label, title: 'key::label2') }
set(:kv_label3) { create(:label, title: 'key::label3') }
let_it_be(:kv_label1) { create(:label, title: 'key::label1') }
let_it_be(:kv_label2) { create(:label, title: 'key::label2') }
let_it_be(:kv_label3) { create(:label, title: 'key::label3') }
describe '.from_label_ids' do
def get_labels(sets, key)
......
......@@ -9,8 +9,8 @@ describe Upload do
subject { create(:upload, checksum: '8710d2c16809c79fee211a9693b64038a8aae99561bc86ce98a9b46b45677fe4') }
context 'when running in a Geo primary node' do
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
it 'logs an event to the Geo event log' do
stub_current_geo_node(primary)
......
......@@ -281,8 +281,8 @@ describe Vulnerabilities::Occurrence do
end
describe '.undismissed' do
set(:project) { create(:project) }
set(:project2) { create(:project) }
let_it_be(:project) { create(:project) }
let_it_be(:project2) { create(:project) }
let!(:finding1) { create(:vulnerabilities_occurrence, project: project) }
let!(:finding2) { create(:vulnerabilities_occurrence, project: project, report_type: :dast) }
let!(:finding3) { create(:vulnerabilities_occurrence, project: project2) }
......@@ -419,7 +419,7 @@ describe Vulnerabilities::Occurrence do
end
describe 'feedback' do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:occurrence) do
create(
:vulnerabilities_occurrence,
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let_it_be(:project, reload: true) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:service) { described_class.new(project, user) }
let(:merge_request) do
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
describe AutoMerge::MergeTrainService do
include ExclusiveLeaseHelpers
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:service) { described_class.new(project, user, params) }
let(:params) { {} }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Ci::CompareMetricsReportsService do
set(:project) { create(:project, :repository) }
let_it_be(:project) { create(:project, :repository) }
let(:service) { described_class.new(project) }
before do
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe Ci::CreateCrossProjectPipelineService, '#execute' do
set(:user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:upstream_project) { create(:project, :repository) }
set(:downstream_project) { create(:project, :repository) }
let_it_be(:downstream_project) { create(:project, :repository) }
let!(:upstream_pipeline) do
create(:ci_pipeline, :running, project: upstream_project)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Ci::CreatePipelineService do
subject(:execute) { service.execute(:push) }
set(:downstream_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'some'))}
let_it_be(:downstream_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'some')) }
let(:project) { create(:project, :repository) }
let(:user) { create(:admin) }
let(:service) { described_class.new(project, user, { ref: 'refs/heads/master' }) }
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
describe Ci::CreatePipelineService, '#execute' do
set(:namespace) { create(:namespace) }
set(:gold_plan) { create(:gold_plan) }
set(:plan_limits) { create(:plan_limits, plan: gold_plan) }
set(:project) { create(:project, :repository, namespace: namespace) }
set(:user) { create(:user) }
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan) { create(:gold_plan) }
let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:user) { create(:user) }
let(:ref_name) { 'master' }
let(:service) do
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe Ci::CreateWebIdeTerminalService do
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:ref) { 'master' }
before do
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
describe Ci::ProcessPipelineService, '#execute' do
set(:user) { create(:user) }
set(:project) { create(:project, :repository) }
set(:downstream) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:downstream) { create(:project, :repository) }
set(:pipeline) do
let_it_be(:pipeline) do
create(:ci_empty_pipeline, ref: 'master', project: project, user: user)
end
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Ci::RegisterJobService do
set(:shared_runner) { create(:ci_runner, :instance) }
let_it_be(:shared_runner) { create(:ci_runner, :instance) }
let!(:project) { create :project, shared_runners_enabled: true }
let!(:pipeline) { create :ci_empty_pipeline, project: project }
let!(:pending_build) { create :ci_build, pipeline: pipeline }
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe Ci::WebIdeConfigService do
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:sha) { 'sha' }
describe '#execute' do
......
......@@ -5,9 +5,9 @@ require 'spec_helper'
describe Clusters::Applications::PrometheusConfigService do
include Gitlab::Routing.url_helpers
set(:project) { create(:project) }
set(:production) { create(:environment, project: project) }
set(:cluster) { create(:cluster, :provided_by_user, projects: [project]) }
let_it_be(:project) { create(:project) }
let_it_be(:production) { create(:environment, project: project) }
let_it_be(:cluster) { create(:cluster, :provided_by_user, projects: [project]) }
let(:application) do
create(:clusters_applications_prometheus, :installed, cluster: cluster)
......
......@@ -3,9 +3,9 @@ require 'spec_helper'
describe DesignManagement::DeleteDesignsService do
include DesignManagementTestHelpers
set(:project) { create(:project) }
set(:issue) { create(:issue, project: project) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:issue) { create(:issue, project: project) }
let_it_be(:user) { create(:user) }
let(:designs) { create_designs }
subject(:service) { described_class.new(project, user, issue: issue, designs: designs) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe DesignManagement::DesignUserNotesCountService, :use_clean_rails_memory_store_caching do
set(:design) { create(:design, :with_file) }
let_it_be(:design) { create(:design, :with_file) }
subject { described_class.new(design) }
......
......@@ -5,11 +5,11 @@ require 'spec_helper'
describe Git::BranchPushService do
include RepoHelpers
set(:user) { create(:user) }
let(:blankrev) { Gitlab::Git::BLANK_SHA }
let(:oldrev) { sample_commit.parent_id }
let(:newrev) { sample_commit.id }
let(:ref) { 'refs/heads/master' }
let_it_be(:user) { create(:user) }
let(:blankrev) { Gitlab::Git::BLANK_SHA }
let(:oldrev) { sample_commit.parent_id }
let(:newrev) { sample_commit.id }
let(:ref) { 'refs/heads/master' }
let(:params) do
{ change: { oldrev: oldrev, newrev: newrev, ref: ref } }
......@@ -20,7 +20,7 @@ describe Git::BranchPushService do
end
context 'with pull project' do
set(:project) { create(:project, :repository, :mirror) }
let_it_be(:project) { create(:project, :repository, :mirror) }
before do
allow(project.repository).to receive(:commit).and_call_original
......@@ -152,7 +152,7 @@ describe Git::BranchPushService do
end
context 'Jira Connect hooks' do
set(:project) { create(:project, :repository) }
let_it_be(:project) { create(:project, :repository) }
let(:branch_to_sync) { nil }
let(:commits_to_sync) { [] }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe MergeRequests::BaseService do
include ProjectForksHelper
set(:project) { create(:project, :repository) }
let_it_be(:project) { create(:project, :repository) }
let(:title) { 'Awesome merge_request' }
let(:params) do
{
......
......@@ -4,9 +4,9 @@ require 'spec_helper'
describe Notes::CreateService do
context 'notes for designs' do
set(:design) { create(:design, :with_file) }
set(:project) { design.project }
set(:user) { project.owner }
let_it_be(:design) { create(:design, :with_file) }
let_it_be(:project) { design.project }
let_it_be(:user) { project.owner }
subject(:service) { described_class.new(project, user, opts) }
......
......@@ -12,11 +12,11 @@ describe EE::NotificationService, :mailer do
let(:mailer) { double(deliver_later: true) }
context 'when notified of a new design diff note' do
set(:design) { create(:design, :with_file) }
set(:project) { design.project }
set(:dev) { create(:user) }
set(:stranger) { create(:user) }
set(:note) do
let_it_be(:design) { create(:design, :with_file) }
let_it_be(:project) { design.project }
let_it_be(:dev) { create(:user) }
let_it_be(:stranger) { create(:user) }
let_it_be(:note) do
create(:diff_note_on_design,
noteable: design,
project: project,
......@@ -412,8 +412,8 @@ describe EE::NotificationService, :mailer do
end
describe 'epics' do
set(:group) { create(:group, :private) }
set(:epic) { create(:epic, group: group) }
let_it_be(:group) { create(:group, :private) }
let_it_be(:epic) { create(:epic, group: group) }
around do |example|
perform_enqueued_jobs do
......
......@@ -16,16 +16,16 @@ describe ResourceEvents::MergeIntoNotesService do
create(:resource_weight_event, event_params.merge(params))
end
set(:project) { create(:project) }
set(:user) { create(:user) }
set(:resource) { create(:issue, project: project) }
set(:label) { create(:label, project: project) }
set(:label2) { create(:label, project: project) }
set(:scoped_label_group1_1) { create(:label, project: project, title: 'key::value') }
set(:scoped_label_group1_2) { create(:label, project: project, title: 'key::value2') }
set(:scoped_label_group2_1) { create(:label, project: project, title: 'key2::value') }
set(:scoped_label_group2_2) { create(:label, project: project, title: 'key2::value2') }
set(:scoped_label_group3_1) { create(:label, project: project, title: 'key3::value') }
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:resource) { create(:issue, project: project) }
let_it_be(:label) { create(:label, project: project) }
let_it_be(:label2) { create(:label, project: project) }
let_it_be(:scoped_label_group1_1) { create(:label, project: project, title: 'key::value') }
let_it_be(:scoped_label_group1_2) { create(:label, project: project, title: 'key::value2') }
let_it_be(:scoped_label_group2_1) { create(:label, project: project, title: 'key2::value') }
let_it_be(:scoped_label_group2_2) { create(:label, project: project, title: 'key2::value2') }
let_it_be(:scoped_label_group3_1) { create(:label, project: project, title: 'key3::value') }
let(:time) { Time.now }
describe '#execute' do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::CacheInvalidationEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:cache_key) { 'cache-key' }
......
......@@ -6,7 +6,7 @@ describe Geo::ContainerRepositorySyncService, :geo do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
let(:registry) { create(:container_repository_registry, :sync_started) }
let(:container_repository) { registry.container_repository }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::ContainerRepositoryUpdatedEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:container_repository) { create :container_repository }
......
......@@ -6,9 +6,9 @@ describe Geo::DesignRepositorySyncService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
set(:project) { create(:project_empty_repo) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
let_it_be(:project) { create(:project_empty_repo) }
let(:repository) { project.design_repository }
let(:lease_key) { "geo_sync_service:design:#{project.id}" }
......
......@@ -6,8 +6,8 @@ describe Geo::FileDownloadService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
before do
stub_current_geo_node(secondary)
......
......@@ -6,7 +6,7 @@ describe Geo::FileRegistryRemovalService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
before do
stub_current_geo_node(secondary)
......@@ -190,7 +190,7 @@ describe Geo::FileRegistryRemovalService do
end
context 'with namespace_file' do
set(:group) { create(:group) }
let_it_be(:group) { create(:group) }
let(:file) { fixture_file_upload('spec/fixtures/dk.png', 'image/png') }
let!(:upload) do
NamespaceFileUploader.new(group).store!(file)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::FileUploadService do
include EE::GeoHelpers
set(:node) { create(:geo_node, :primary) }
let_it_be(:node) { create(:geo_node, :primary) }
let(:transfer_request) { Gitlab::Geo::TransferRequest.new(request_data) }
let(:req_header) { transfer_request.headers['Authorization'] }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::HashedStorageAttachmentsEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:project) { create(:project, path: 'bar') }
let(:attachments_event) { build(:geo_hashed_storage_attachments_event, project: project) }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::HashedStorageMigratedEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:project) { create(:project, :design_repo, path: 'bar') }
let(:old_disk_path) { "#{project.namespace.full_path}/foo" }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::JobArtifactDeletedEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:job_artifact) { create(:ci_job_artifact, :archive) }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::LfsObjectDeletedEventStore do
include EE::GeoHelpers
set(:secondary_node) { create(:geo_node) }
let_it_be(:secondary_node) { create(:geo_node) }
let(:lfs_object) { create(:lfs_object, :with_file, oid: 'b68143e6463773b1b6c6fd009a76c32aeec041faff32ba2ed42fd7f708a00004') }
......
......@@ -5,9 +5,9 @@ require 'spec_helper'
describe Geo::MetricsUpdateService, :geo, :prometheus do
include ::EE::GeoHelpers
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
set(:another_secondary) { create(:geo_node) }
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
let_it_be(:another_secondary) { create(:geo_node) }
subject { described_class.new }
......
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