Commit 2e64976d authored by nmilojevic1's avatar nmilojevic1 Committed by Peter Leitzen

Use wrap_original for stubing delete_all_refs

parent 6c6a354f
......@@ -77,9 +77,8 @@ describe Projects::AfterImportService do
before do
call_count = 0
original_method = repository.method(:delete_all_refs_except)
allow(repository).to receive(:delete_all_refs_except) do |*args|
allow(repository).to receive(:delete_all_refs_except).and_wrap_original do |original_method, *args|
call_count += 1
call_count > 1 ? original_method.call(*args) : raise(exception)
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