summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export/shared_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/import_export/shared_spec.rb')
-rw-r--r--spec/lib/gitlab/import_export/shared_spec.rb24
1 files changed, 6 insertions, 18 deletions
diff --git a/spec/lib/gitlab/import_export/shared_spec.rb b/spec/lib/gitlab/import_export/shared_spec.rb
index fc011f7e1be..8c16243576d 100644
--- a/spec/lib/gitlab/import_export/shared_spec.rb
+++ b/spec/lib/gitlab/import_export/shared_spec.rb
@@ -1,8 +1,11 @@
+# frozen_string_literal: true
+
require 'spec_helper'
require 'fileutils'
describe Gitlab::ImportExport::Shared do
let(:project) { build(:project) }
+
subject { project.import_export_shared }
context 'with a repository on disk' do
@@ -46,24 +49,9 @@ describe Gitlab::ImportExport::Shared do
it 'updates the import JID' do
import_state = create(:import_state, project: project, jid: 'jid-test')
- expect_next_instance_of(Gitlab::Import::Logger) do |logger|
- expect(logger).to receive(:error).with(hash_including(import_jid: import_state.jid))
- end
-
- subject.error(error)
- end
-
- it 'calls the error logger without a backtrace' do
- expect(subject).to receive(:log_error).with(message: error.message)
-
- subject.error(error)
- end
-
- it 'calls the error logger with the full message' do
- backtrace = caller
- allow(error).to receive(:backtrace).and_return(caller)
-
- expect(subject).to receive(:log_error).with(message: error.message, error_backtrace: Gitlab::Profiler.clean_backtrace(backtrace))
+ expect(Gitlab::ErrorTracking)
+ .to receive(:track_exception)
+ .with(error, hash_including(import_jid: import_state.jid))
subject.error(error)
end