Commit c1178654 authored by nmilojevic1's avatar nmilojevic1

Fix from MR discussions

- Make specs more readable
- Remove momorization from after_import_service
parent 146eef9f
......@@ -29,11 +29,11 @@ module Projects
private
def import_failure_service
@import_failure_service ||= Gitlab::ImportExport::ImportFailureService.new(@project)
Gitlab::ImportExport::ImportFailureService.new(@project)
end
def repository
@repository ||= @project.repository
@project.repository
end
end
end
......@@ -76,12 +76,12 @@ describe Projects::AfterImportService do
let(:exception) { GRPC::DeadlineExceeded.new }
before do
call_count = 0
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
expect(repository)
.to receive(:delete_all_refs_except)
.and_raise(exception)
expect(repository)
.to receive(:delete_all_refs_except)
.and_call_original
subject.execute
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