Commit f6f2024a authored by Sean McGivern's avatar Sean McGivern

Ensure that reenqueuer always returns the original value

parent b5afee0a
......@@ -52,7 +52,11 @@ module Reenqueuer
private
def reenqueue(*args)
self.class.perform_async(*args) if yield
result = yield
self.class.perform_async(*args) if result
result
end
# Override as needed
......
......@@ -79,6 +79,10 @@ RSpec.describe Reenqueuer do
job.perform
end
it 'returns the original value from #perform' do
expect(job.perform).to eq(true)
end
end
context 'when #perform returns falsey' do
......@@ -87,6 +91,10 @@ RSpec.describe Reenqueuer do
job.perform
end
it 'returns the original value from #perform' do
expect(job.perform).to eq(false)
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment