diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/requests/api/group_export_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/requests/api/group_export_spec.rb')
-rw-r--r-- | spec/requests/api/group_export_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/requests/api/group_export_spec.rb b/spec/requests/api/group_export_spec.rb index d0f7c000544..c48ade1cb8b 100644 --- a/spec/requests/api/group_export_spec.rb +++ b/spec/requests/api/group_export_spec.rb @@ -311,6 +311,8 @@ RSpec.describe API::GroupExport, feature_category: :importers do expect(response).to have_gitlab_http_status(:ok) expect(json_response.pluck('relation')).to contain_exactly('labels', 'milestones', 'badges') expect(json_response.pluck('status')).to contain_exactly(-1, 0, 1) + expect(json_response.pluck('batched')).to all(eq(false)) + expect(json_response.pluck('batches_count')).to all(eq(0)) end context 'when relation is specified' do @@ -322,6 +324,36 @@ RSpec.describe API::GroupExport, feature_category: :importers do expect(json_response['status']).to eq(0) end end + + context 'when there is a batched export' do + let_it_be(:batched_export) do + create(:bulk_import_export, :started, :batched, group: group, relation: 'boards', batches_count: 1) + end + + let_it_be(:batch) { create(:bulk_import_export_batch, objects_count: 5, export: batched_export) } + + it 'returns a list of batched relation export statuses' do + get api(status_path, user) + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response).to include( + hash_including( + 'relation' => batched_export.relation, + 'batched' => true, + 'batches_count' => 1, + 'batches' => contain_exactly( + { + 'batch_number' => 1, + 'error' => nil, + 'objects_count' => batch.objects_count, + 'status' => batch.status, + 'updated_at' => batch.updated_at.as_json + } + ) + ) + ) + end + end end context 'when bulk import is disabled' do |