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:
authorStan Hu <stanhu@gmail.com>2018-06-11 19:47:51 +0300
committerStan Hu <stanhu@gmail.com>2018-06-11 19:47:51 +0300
commit96ce4ed25c7633330f82439f1f9347f6eef8568a (patch)
tree39544ac46f9172132091fc25d867b94725df2011 /spec/models
parent6defeb0a7d6928ad32d4d7a2fa35d0d71dbb9dea (diff)
Work around limitations of expect_any_instance_of by stubbing Project.find
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index d385d617731..adb6ea94ac7 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1726,7 +1726,11 @@ describe Project do
.with(project.repository_storage, project.disk_path, project.import_url)
.and_return(true)
- expect_any_instance_of(Repository).to receive(:after_import)
+ # Works around https://github.com/rspec/rspec-mocks/issues/910
+ expect(Project).to receive(:find).with(project.id).twice.and_return(project)
+ expect(project.repository).to receive(:after_import)
+ .and_call_original
+ expect(project.wiki.repository).to receive(:after_import)
.and_call_original
end