diff options
Diffstat (limited to 'spec/services/projects')
10 files changed, 32 insertions, 32 deletions
diff --git a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb index 14772d172e8..78b969c8a0e 100644 --- a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb +++ b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' describe Projects::ContainerRepository::CleanupTagsService do - set(:user) { create(:user) } - set(:project) { create(:project, :private) } - set(:repository) { create(:container_repository, :root, project: project) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :private) } + let_it_be(:repository) { create(:container_repository, :root, project: project) } let(:service) { described_class.new(project, user, params) } diff --git a/spec/services/projects/container_repository/delete_tags_service_spec.rb b/spec/services/projects/container_repository/delete_tags_service_spec.rb index 7ceb02c9cf8..decbbb7597f 100644 --- a/spec/services/projects/container_repository/delete_tags_service_spec.rb +++ b/spec/services/projects/container_repository/delete_tags_service_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' describe Projects::ContainerRepository::DeleteTagsService do - set(:user) { create(:user) } - set(:project) { create(:project, :private) } - set(:repository) { create(:container_repository, :root, project: project) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :private) } + let_it_be(:repository) { create(:container_repository, :root, project: project) } let(:params) { { tags: tags } } let(:service) { described_class.new(project, user, params) } diff --git a/spec/services/projects/container_repository/destroy_service_spec.rb b/spec/services/projects/container_repository/destroy_service_spec.rb index affcc66d2bb..cc8fd2716e1 100644 --- a/spec/services/projects/container_repository/destroy_service_spec.rb +++ b/spec/services/projects/container_repository/destroy_service_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Projects::ContainerRepository::DestroyService do - set(:user) { create(:user) } - set(:project) { create(:project, :private) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :private) } subject { described_class.new(project, user) } diff --git a/spec/services/projects/detect_repository_languages_service_spec.rb b/spec/services/projects/detect_repository_languages_service_spec.rb index df5eed18ac0..76600b0e77c 100644 --- a/spec/services/projects/detect_repository_languages_service_spec.rb +++ b/spec/services/projects/detect_repository_languages_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::DetectRepositoryLanguagesService, :clean_gitlab_redis_shared_state do - set(:project) { create(:project, :repository) } + let_it_be(:project, reload: true) { create(:project, :repository) } subject { described_class.new(project) } @@ -51,7 +51,7 @@ describe Projects::DetectRepositoryLanguagesService, :clean_gitlab_redis_shared_ end context 'when no repository exists' do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } it 'has no languages' do expect(subject.execute).to be_empty diff --git a/spec/services/projects/gitlab_projects_import_service_spec.rb b/spec/services/projects/gitlab_projects_import_service_spec.rb index 78580bfa604..1662d4577aa 100644 --- a/spec/services/projects/gitlab_projects_import_service_spec.rb +++ b/spec/services/projects/gitlab_projects_import_service_spec.rb @@ -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(:file) { fixture_file_upload('spec/fixtures/project_export.tar.gz') } let(:overwrite) { false } diff --git a/spec/services/projects/housekeeping_service_spec.rb b/spec/services/projects/housekeeping_service_spec.rb index c99054d9fd5..60804a8dba6 100644 --- a/spec/services/projects/housekeeping_service_spec.rb +++ b/spec/services/projects/housekeeping_service_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' describe Projects::HousekeepingService do subject { described_class.new(project) } - set(:project) { create(:project, :repository) } + let_it_be(:project) { create(:project, :repository) } before do project.reset_pushes_since_gc diff --git a/spec/services/projects/open_merge_requests_count_service_spec.rb b/spec/services/projects/open_merge_requests_count_service_spec.rb index f9fff4cbd4c..7d848f9f2c3 100644 --- a/spec/services/projects/open_merge_requests_count_service_spec.rb +++ b/spec/services/projects/open_merge_requests_count_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::OpenMergeRequestsCountService, :use_clean_rails_memory_store_caching do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } subject { described_class.new(project) } diff --git a/spec/services/projects/operations/update_service_spec.rb b/spec/services/projects/operations/update_service_spec.rb index 81d59a98b9b..93cd5c43e86 100644 --- a/spec/services/projects/operations/update_service_spec.rb +++ b/spec/services/projects/operations/update_service_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Projects::Operations::UpdateService do - set(:user) { create(:user) } - set(:project) { create(:project) } + let_it_be(:user) { create(:user) } + let_it_be(:project, reload: true) { create(:project) } let(:result) { subject.execute } diff --git a/spec/services/projects/participants_service_spec.rb b/spec/services/projects/participants_service_spec.rb index 239d28557ee..6eaf7a71b23 100644 --- a/spec/services/projects/participants_service_spec.rb +++ b/spec/services/projects/participants_service_spec.rb @@ -4,8 +4,8 @@ require 'spec_helper' describe Projects::ParticipantsService do describe '#groups' do - set(:user) { create(:user) } - set(:project) { create(:project, :public) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :public) } let(:service) { described_class.new(project, user) } it 'avoids N+1 queries' do @@ -62,10 +62,10 @@ describe Projects::ParticipantsService do subject(:usernames) { service.project_members.map { |member| member[:username] } } context 'when there is a project in group namespace' do - set(:public_group) { create(:group, :public) } - set(:public_project) { create(:project, :public, namespace: public_group)} + let_it_be(:public_group) { create(:group, :public) } + let_it_be(:public_project) { create(:project, :public, namespace: public_group)} - set(:public_group_owner) { create(:user) } + let_it_be(:public_group_owner) { create(:user) } let(:service) { described_class.new(public_project, create(:user)) } @@ -79,18 +79,18 @@ describe Projects::ParticipantsService do end context 'when there is a private group and a public project' do - set(:public_group) { create(:group, :public) } - set(:private_group) { create(:group, :private, :nested) } - set(:public_project) { create(:project, :public, namespace: public_group)} + let_it_be(:public_group) { create(:group, :public) } + let_it_be(:private_group) { create(:group, :private, :nested) } + let_it_be(:public_project) { create(:project, :public, namespace: public_group)} - set(:project_issue) { create(:issue, project: public_project)} + let_it_be(:project_issue) { create(:issue, project: public_project)} - set(:public_group_owner) { create(:user) } - set(:private_group_member) { create(:user) } - set(:public_project_maintainer) { create(:user) } - set(:private_group_owner) { create(:user) } + let_it_be(:public_group_owner) { create(:user) } + let_it_be(:private_group_member) { create(:user) } + let_it_be(:public_project_maintainer) { create(:user) } + let_it_be(:private_group_owner) { create(:user) } - set(:group_ancestor_owner) { create(:user) } + let_it_be(:group_ancestor_owner) { create(:user) } before(:context) do public_group.add_owner public_group_owner diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb index 9aa8c7f85ca..001c6670f4b 100644 --- a/spec/services/projects/update_pages_service_spec.rb +++ b/spec/services/projects/update_pages_service_spec.rb @@ -3,9 +3,9 @@ require "spec_helper" describe Projects::UpdatePagesService do - set(:project) { create(:project, :repository) } - set(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit('HEAD').sha) } - set(:build) { create(:ci_build, pipeline: pipeline, ref: 'HEAD') } + let_it_be(:project, refind: true) { create(:project, :repository) } + let_it_be(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit('HEAD').sha) } + let_it_be(:build) { create(:ci_build, pipeline: pipeline, ref: 'HEAD') } let(:invalid_file) { fixture_file_upload('spec/fixtures/dk.png') } let(:file) { fixture_file_upload("spec/fixtures/pages.zip") } |