summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorJoão Cunha <j.a.cunha@gmail.com>2019-03-01 11:44:11 +0000
committerJoão Cunha <j.a.cunha@gmail.com>2019-03-28 15:50:47 +0000
commit4e5a9838fa97c9637ac36d5fd339dc311a8443b1 (patch)
tree647b13172987e91fb2039feece84540dc7c7cc90 /spec/support
parent04496085c1b83ccf5d9bfa546daf2a92e9c644e7 (diff)
downloadgitlab-ce-4e5a9838fa97c9637ac36d5fd339dc311a8443b1.tar.gz
Refactor subbed_worker callsrefactor/ce_stubbed_worker
- Creates a support/helper file and moves all the duplication defs into it
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers/stub_worker.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_worker.rb b/spec/support/helpers/stub_worker.rb
new file mode 100644
index 00000000000..58b7ee93dff
--- /dev/null
+++ b/spec/support/helpers/stub_worker.rb
@@ -0,0 +1,9 @@
+# Inspired by https://github.com/ljkbennett/stub_env/blob/master/lib/stub_env/helpers.rb
+module StubWorker
+ def stub_worker(queue:)
+ Class.new do
+ include Sidekiq::Worker
+ sidekiq_options queue: queue
+ end
+ end
+end