Commit 5aaa2f4c authored by Thong Kuah's avatar Thong Kuah

Merge branch 'replace-set-with-let-it-be-in-ee-spec-finders' into 'master'

Replace set to let_it_be in ee/spec/finders

See merge request gitlab-org/gitlab!22786
parents 34333ec0 3d7fe150
......@@ -4,9 +4,9 @@ require 'spec_helper'
describe AuditLogFinder do
describe '#execute' do
set(:user_audit_event) { create(:user_audit_event, created_at: 3.days.ago) }
set(:project_audit_event) { create(:project_audit_event, created_at: 2.days.ago) }
set(:group_audit_event) { create(:group_audit_event, created_at: 1.day.ago) }
let_it_be(:user_audit_event) { create(:user_audit_event, created_at: 3.days.ago) }
let_it_be(:project_audit_event) { create(:project_audit_event, created_at: 2.days.ago) }
let_it_be(:group_audit_event) { create(:group_audit_event, created_at: 1.day.ago) }
subject { described_class.new(params).execute }
......
......@@ -5,11 +5,11 @@ require 'spec_helper'
describe DesignManagement::VersionsFinder do
include DesignManagementTestHelpers
set(:user) { create(:user) }
set(:project) { create(:project, :private) }
set(:issue) { create(:issue, project: project) }
set(:design_1) { create(:design, :with_file, issue: issue, versions_count: 1) }
set(:design_2) { create(:design, :with_file, issue: issue, versions_count: 1) }
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :private) }
let_it_be(:issue) { create(:issue, project: project) }
let_it_be(:design_1) { create(:design, :with_file, issue: issue, versions_count: 1) }
let_it_be(:design_2) { create(:design, :with_file, issue: issue, versions_count: 1) }
let(:version_1) { design_1.versions.first }
let(:version_2) { design_2.versions.first }
let(:design_or_collection) { issue.design_collection }
......
......@@ -4,19 +4,19 @@ require 'spec_helper'
describe Geo::ProjectRegistryStatusFinder, :geo, :geo_tracking_db do
include ::EE::GeoHelpers
set(:secondary) { create(:geo_node) }
let_it_be(:secondary) { create(:geo_node) }
set(:synced_registry) { create(:geo_project_registry, :synced) }
set(:synced_and_verified_registry) { create(:geo_project_registry, :synced, :repository_verified) }
set(:sync_pending_registry) { create(:geo_project_registry, :synced, :repository_dirty) }
set(:sync_failed_registry) { create(:geo_project_registry, :existing_repository_sync_failed) }
let_it_be(:synced_registry) { create(:geo_project_registry, :synced) }
let_it_be(:synced_and_verified_registry) { create(:geo_project_registry, :synced, :repository_verified) }
let_it_be(:sync_pending_registry) { create(:geo_project_registry, :synced, :repository_dirty) }
let_it_be(:sync_failed_registry) { create(:geo_project_registry, :existing_repository_sync_failed) }
set(:verify_outdated_registry) { create(:geo_project_registry, :synced, :repository_verification_outdated) }
set(:verify_failed_registry) { create(:geo_project_registry, :synced, :repository_verification_failed) }
set(:verify_checksum_mismatch_registry) { create(:geo_project_registry, :synced, :repository_checksum_mismatch) }
let_it_be(:verify_outdated_registry) { create(:geo_project_registry, :synced, :repository_verification_outdated) }
let_it_be(:verify_failed_registry) { create(:geo_project_registry, :synced, :repository_verification_failed) }
let_it_be(:verify_checksum_mismatch_registry) { create(:geo_project_registry, :synced, :repository_checksum_mismatch) }
set(:never_synced_registry) { create(:geo_project_registry) }
set(:never_synced_registry_with_failure) { create(:geo_project_registry, :repository_sync_failed) }
let_it_be(:never_synced_registry) { create(:geo_project_registry) }
let_it_be(:never_synced_registry_with_failure) { create(:geo_project_registry, :repository_sync_failed) }
before do
stub_current_geo_node(secondary)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Geo::RepositoryVerificationFinder do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
describe '#find_failed_repositories' do
it 'returns projects where next retry attempt is in the past' do
......
......@@ -3,17 +3,17 @@
require 'spec_helper'
describe GroupsWithTemplatesFinder do
set(:group_1) { create(:group, name: 'group-1') }
set(:group_2) { create(:group, name: 'group-2') }
set(:group_3) { create(:group, name: 'group-3') }
set(:group_4) { create(:group, name: 'group-4') }
let_it_be(:group_1, reload: true) { create(:group, name: 'group-1') }
let_it_be(:group_2, reload: true) { create(:group, name: 'group-2') }
let_it_be(:group_3, reload: true) { create(:group, name: 'group-3') }
let_it_be(:group_4, reload: true) { create(:group, name: 'group-4') }
set(:subgroup_1) { create(:group, parent: group_1, name: 'subgroup-1') }
set(:subgroup_2) { create(:group, parent: group_2, name: 'subgroup-2') }
set(:subgroup_3) { create(:group, parent: group_3, name: 'subgroup-3') }
let_it_be(:subgroup_1) { create(:group, parent: group_1, name: 'subgroup-1') }
let_it_be(:subgroup_2) { create(:group, parent: group_2, name: 'subgroup-2') }
let_it_be(:subgroup_3) { create(:group, parent: group_3, name: 'subgroup-3') }
set(:subgroup_4) { create(:group, parent: group_1, name: 'subgroup-4') }
set(:subgroup_5) { create(:group, parent: subgroup_4, name: 'subgroup-5') }
let_it_be(:subgroup_4, reload: true) { create(:group, parent: group_1, name: 'subgroup-4') }
let_it_be(:subgroup_5) { create(:group, parent: subgroup_4, name: 'subgroup-5') }
before do
group_1.update!(custom_project_templates_group_id: subgroup_1.id)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe LicenseTemplateFinder do
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:params) { {} }
let(:fake_template_source) { double(::Gitlab::CustomFileTemplates) }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe LicensesFinder do
let(:license) { create(:license) }
set(:user) { create(:admin) }
let_it_be(:user) { create(:admin) }
it 'returns a license by id' do
expect(described_class.new(user, id: license.id).execute.take).to eq(license)
......
......@@ -75,7 +75,7 @@ describe Packages::GroupPackagesFinder do
end
context 'when project is public' do
set(:other_user) { create(:user) }
let_it_be(:other_user) { create(:user) }
let(:finder) { described_class.new(other_user, group) }
before do
......
......@@ -7,15 +7,15 @@ describe Projects::Prometheus::AlertsFinder do
let(:params) { {} }
describe 'with params' do
set(:project) { create(:project) }
set(:other_project) { create(:project) }
set(:other_env) { create(:environment, project: other_project) }
set(:production) { create(:environment, project: project) }
set(:staging) { create(:environment, project: project) }
set(:alert) { create_alert(project, production) }
set(:alert2) { create_alert(project, production) }
set(:stg_alert) { create_alert(project, staging) }
set(:other_alert) { create_alert(other_project, other_env) }
let_it_be(:project) { create(:project) }
let_it_be(:other_project) { create(:project) }
let_it_be(:other_env) { create(:environment, project: other_project) }
let_it_be(:production) { create(:environment, project: project) }
let_it_be(:staging) { create(:environment, project: project) }
let_it_be(:alert) { create_alert(project, production) }
let_it_be(:alert2) { create_alert(project, production) }
let_it_be(:stg_alert) { create_alert(project, staging) }
let_it_be(:other_alert) { create_alert(other_project, other_env) }
describe '#execute' do
subject { finder.execute }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe TemplateFinder do
using RSpec::Parameterized::TableSyntax
set(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:params) { {} }
......
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