diff options
author | Nick Thomas <nick@gitlab.com> | 2016-12-20 13:16:07 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-12-20 13:16:07 +0000 |
commit | 1139da2745eb28be17c8fd6aa0f5de113c0f06a9 (patch) | |
tree | cccbae8b3a7d46cc9d673b114cae143c8f70b5c5 /spec/workers | |
parent | a85220506eb3a7516008a1ffe67beff9550cdd1c (diff) | |
parent | f73193c328b871a9a3af803012c10d9bc1bd0904 (diff) | |
download | gitlab-ce-1139da2745eb28be17c8fd6aa0f5de113c0f06a9.tar.gz |
Merge branch 'project-authorizations-diff' into 'master'
Smarter refreshing of authorized projects
This MR reworks the way `User#refresh_authorized_projects`, resulting in a much more efficient process leading to fewer dead tuples.
Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/25257
See merge request !7956
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/authorized_projects_worker_spec.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/spec/workers/authorized_projects_worker_spec.rb b/spec/workers/authorized_projects_worker_spec.rb index 95e2458da35..b6591f272f6 100644 --- a/spec/workers/authorized_projects_worker_spec.rb +++ b/spec/workers/authorized_projects_worker_spec.rb @@ -7,27 +7,17 @@ describe AuthorizedProjectsWorker do it "refreshes user's authorized projects" do user = create(:user) - expect(worker).to receive(:refresh).with(an_instance_of(User)) + expect_any_instance_of(User).to receive(:refresh_authorized_projects) worker.perform(user.id) end context "when the user is not found" do it "does nothing" do - expect(worker).not_to receive(:refresh) + expect_any_instance_of(User).not_to receive(:refresh_authorized_projects) described_class.new.perform(-1) end end end - - describe '#refresh', redis: true do - it 'refreshes the authorized projects of the user' do - user = create(:user) - - expect(user).to receive(:refresh_authorized_projects) - - worker.refresh(user) - end - end end |