Commit aec47fad authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'replace-set-to-let-it-be-in-ee-spec-services-projects' into 'master'

Change set with let_it_be in ee/spec/services/projects

See merge request gitlab-org/gitlab!22523
parents da5da758 3be85a53
......@@ -7,8 +7,8 @@ describe Projects::AfterRenameService do
describe '#execute' 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(:project) { create(:project, :repository, :legacy_storage) }
let!(:path_before_rename) { project.path }
let!(:full_path_before_rename) { project.full_path }
......
......@@ -3,10 +3,10 @@
require 'spec_helper'
describe Projects::Alerting::NotifyService do
set(:project) { create(:project) }
let_it_be(:project, reload: true) { create(:project) }
before do
# We use `set(:project)` so we make sure to clear caches
# We use `let_it_be(:project)` so we make sure to clear caches
project.clear_memoization(:licensed_feature_available)
end
......
......@@ -212,8 +212,8 @@ describe Projects::CreateService, '#execute' do
end
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) }
before do
stub_current_geo_node(primary)
......
......@@ -34,8 +34,8 @@ describe Projects::DestroyService do
end
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) }
before do
stub_current_geo_node(primary)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Projects::GitlabProjectsImportService do
set(:namespace) { create(:namespace) }
let_it_be(:namespace) { create(:namespace) }
let(:path) { 'test-path' }
let(:custom_template) { create(:project) }
let(:overwrite) { false }
......
......@@ -11,8 +11,8 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
let(:old_attachments_path) { legacy_storage.disk_path }
let(:new_attachments_path) { hashed_storage.disk_path }
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) }
subject { described_class.new(project: project, old_disk_path: old_attachments_path) }
......
......@@ -4,8 +4,8 @@ require 'spec_helper'
describe Projects::ImportExport::ExportService do
describe '#execute' do
set(:user) { create(:user) }
set(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let(:shared) { project.import_export_shared }
let(:service) { described_class.new(project, user) }
let!(:after_export_strategy) { Gitlab::ImportExport::AfterExportStrategies::DownloadNotificationStrategy.new }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Projects::Operations::UpdateService do
set(:user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:project) { create(:project) }
let(:result) { subject.execute }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe Projects::Prometheus::Alerts::CreateEventsService do
let(:user) { create(:user) }
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:metric) { create(:prometheus_metric, project: project) }
let(:service) { described_class.new(project, user, alerts_payload) }
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe Projects::Prometheus::Alerts::CreateService do
set(:project) { create(:project) }
set(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let(:service) { described_class.new(project, user, params) }
......@@ -12,9 +12,9 @@ describe Projects::Prometheus::Alerts::CreateService do
describe '#execute' do
context 'with params' do
set(:environment) { create(:environment, project: project) }
let_it_be(:environment) { create(:environment, project: project) }
set(:metric) do
let_it_be(:metric) do
create(:prometheus_metric, project: project)
end
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
describe Projects::Prometheus::Alerts::DestroyService do
set(:project) { create(:project) }
set(:user) { create(:user) }
set(:alert) { create(:prometheus_alert, project: project) }
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:alert) { create(:prometheus_alert, project: project) }
let(:service) { described_class.new(project, user, nil) }
......
......@@ -3,14 +3,14 @@
require 'spec_helper'
describe Projects::Prometheus::Alerts::NotifyService do
set(:project) { create(:project) }
let_it_be(:project, reload: true) { create(:project) }
let(:service) { described_class.new(project, nil, payload) }
let(:token_input) { 'token' }
let(:subject) { service.execute(token_input) }
before do
# We use `set(:project)` so we make sure to clear caches
# We use `let_it_be(:project)` so we make sure to clear caches
project.clear_memoization(:licensed_feature_available)
end
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
describe Projects::Prometheus::Alerts::UpdateService do
set(:project) { create(:project) }
set(:user) { create(:user) }
set(:environment) { create(:environment, project: project) }
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:environment) { create(:environment, project: project) }
set(:alert) do
let_it_be(:alert) do
create(:prometheus_alert, project: project, environment: environment)
end
......
......@@ -16,8 +16,8 @@ describe Projects::TransferService do
end
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) }
it 'logs an event to the Geo event log' do
stub_current_geo_node(primary)
......
......@@ -110,8 +110,8 @@ describe Projects::UpdateService, '#execute' do
context 'triggering wiki Geo syncs', :geo do
context 'on a Geo primary' 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)
......
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