diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-05 03:08:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-05 03:08:11 +0300 |
commit | 59429d48eb1cf7032cf12363b83a045743f02a1e (patch) | |
tree | e4281f1f60bc0f71d315c1eb1bcacd57b9b72590 /spec/models | |
parent | 484a245a95e97ae97f558a3d242f599853eb6d3c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/bulk_imports/export_status_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/bulk_imports/export_status_spec.rb b/spec/models/bulk_imports/export_status_spec.rb index 6ade82409dc..606e663e310 100644 --- a/spec/models/bulk_imports/export_status_spec.rb +++ b/spec/models/bulk_imports/export_status_spec.rb @@ -157,12 +157,20 @@ RSpec.describe BulkImports::ExportStatus do end context 'when something goes wrong during export status fetch' do - it 'returns exception class as error' do + it 'returns exception class as error and memoizes return value' do allow_next_instance_of(BulkImports::Clients::HTTP) do |client| allow(client).to receive(:get).and_raise(StandardError, 'Error!') end expect(subject.error).to eq('Error!') + expect(subject.failed?).to eq(true) + + allow_next_instance_of(BulkImports::Clients::HTTP) do |client| + allow(client).to receive(:get).and_return({ 'relation' => relation, 'status' => 'finished' }) + end + + expect(subject.error).to eq('Error!') + expect(subject.failed?).to eq(true) end end end |