Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/repository_fork_worker_spec.rb')
-rw-r--r--spec/workers/repository_fork_worker_spec.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/workers/repository_fork_worker_spec.rb b/spec/workers/repository_fork_worker_spec.rb
index 4b3c1736ea0..ae4786389c7 100644
--- a/spec/workers/repository_fork_worker_spec.rb
+++ b/spec/workers/repository_fork_worker_spec.rb
@@ -55,10 +55,15 @@ describe RepositoryForkWorker do
it 'flushes various caches' do
expect_fork_repository.and_return(true)
- expect_any_instance_of(Repository).to receive(:expire_emptiness_caches)
+ # Works around https://github.com/rspec/rspec-mocks/issues/910
+ expect(Project).to receive(:find).with(fork_project.id).and_return(fork_project)
+ expect(fork_project.repository).to receive(:expire_emptiness_caches)
.and_call_original
-
- expect_any_instance_of(Repository).to receive(:expire_exists_cache)
+ expect(fork_project.repository).to receive(:expire_exists_cache)
+ .and_call_original
+ expect(fork_project.wiki.repository).to receive(:expire_emptiness_caches)
+ .and_call_original
+ expect(fork_project.wiki.repository).to receive(:expire_exists_cache)
.and_call_original
perform!