diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/workers/authorized_project_update/project_create_worker_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/workers/authorized_project_update/project_create_worker_spec.rb')
-rw-r--r-- | spec/workers/authorized_project_update/project_create_worker_spec.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/spec/workers/authorized_project_update/project_create_worker_spec.rb b/spec/workers/authorized_project_update/project_create_worker_spec.rb deleted file mode 100644 index 5226ab30de7..00000000000 --- a/spec/workers/authorized_project_update/project_create_worker_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe AuthorizedProjectUpdate::ProjectCreateWorker do - let_it_be(:group) { create(:group, :private) } - let_it_be(:group_project) { create(:project, group: group) } - let_it_be(:group_user) { create(:user) } - - let(:access_level) { Gitlab::Access::MAINTAINER } - - subject(:worker) { described_class.new } - - it 'calls AuthorizedProjectUpdate::ProjectCreateService' do - expect_next_instance_of(AuthorizedProjectUpdate::ProjectCreateService) do |service| - expect(service).to(receive(:execute)) - end - - worker.perform(group_project.id) - end - - it 'returns ServiceResponse.success' do - result = worker.perform(group_project.id) - - expect(result.success?).to be_truthy - end - - context 'idempotence' do - before do - create(:group_member, access_level: access_level, group: group, user: group_user) - ProjectAuthorization.delete_all - end - - include_examples 'an idempotent worker' do - let(:job_args) { group_project.id } - - it 'creates project authorization' do - subject - - project_authorization = ProjectAuthorization.where( - project_id: group_project.id, - user_id: group_user.id, - access_level: access_level) - - expect(project_authorization).to exist - expect(ProjectAuthorization.count).to eq(1) - end - end - end -end |