summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-02-28 17:10:28 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2018-02-28 17:10:28 +0100
commite47a2ca30ab9be7ef77ac5fb6fe4a8224dab6f72 (patch)
tree2bc33167c86d3b2119f9dd1df4bc36b2216d4cef
parent65348cf07bafef5efc1c9665d3efdb5a1bdd7128 (diff)
downloadgitlab-ce-build-finished-worker-spec-prepend.tar.gz
Remove use of any_instance_of in runner specbuild-finished-worker-spec-prepend
In EE we prepend a module into BuildFinishedWorker. This would cause this spec to fail because RSpec doesn't support the use of "any_instance_of" with classes that include a prepended module. To work around this we just stub the "perform_async" class method instead of stubbing the "perform" instance method.
-rw-r--r--spec/requests/api/runner_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 4021e537efc..72cafac3f90 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -700,7 +700,7 @@ describe API::Runner do
context 'when tace is given' do
it 'creates a trace artifact' do
- allow_any_instance_of(BuildFinishedWorker).to receive(:perform).with(job.id) do
+ allow(BuildFinishedWorker).to receive(:perform_async).with(job.id) do
CreateTraceArtifactWorker.new.perform(job.id)
end