diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-11 15:10:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-11 15:10:28 +0300 |
commit | e3190840bc2e05ed04a49869978a54b7b518edf1 (patch) | |
tree | 5424582e3fa6c48c6ac8ebb029969e6ac277487c /spec/workers/authorized_projects_worker_spec.rb | |
parent | c7ba7b997608a103a0a9165b2e5cef9530c4ef53 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/authorized_projects_worker_spec.rb')
-rw-r--r-- | spec/workers/authorized_projects_worker_spec.rb | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/spec/workers/authorized_projects_worker_spec.rb b/spec/workers/authorized_projects_worker_spec.rb index 8ce0d4edd4f..93f22471c56 100644 --- a/spec/workers/authorized_projects_worker_spec.rb +++ b/spec/workers/authorized_projects_worker_spec.rb @@ -3,40 +3,5 @@ require 'spec_helper' describe AuthorizedProjectsWorker do - describe '#perform' do - let(:user) { create(:user) } - - subject(:job) { described_class.new } - - it "refreshes user's authorized projects" do - expect_any_instance_of(User).to receive(:refresh_authorized_projects) - - job.perform(user.id) - end - - context "when the user is not found" do - it "does nothing" do - expect_any_instance_of(User).not_to receive(:refresh_authorized_projects) - - job.perform(-1) - end - end - - it_behaves_like "an idempotent worker" do - let(:job_args) { user.id } - - it "does not change authorizations when run twice" do - group = create(:group) - create(:project, namespace: group) - group.add_developer(user) - - # Delete the authorization created by the after save hook of the member - # created above. - user.project_authorizations.delete_all - - expect { job.perform(user.id) }.to change { user.project_authorizations.reload.size }.by(1) - expect { job.perform(user.id) }.not_to change { user.project_authorizations.reload.size } - end - end - end + it_behaves_like "refreshes user's project authorizations" end |