diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /spec/features/groups/import_export | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/features/groups/import_export')
-rw-r--r-- | spec/features/groups/import_export/connect_instance_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/groups/import_export/migration_history_spec.rb | 30 |
2 files changed, 36 insertions, 28 deletions
diff --git a/spec/features/groups/import_export/connect_instance_spec.rb b/spec/features/groups/import_export/connect_instance_spec.rb index cf893e444c4..552b599a3f3 100644 --- a/spec/features/groups/import_export/connect_instance_spec.rb +++ b/spec/features/groups/import_export/connect_instance_spec.rb @@ -19,34 +19,12 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do end context 'when the user provides valid credentials' do + source_url = 'https://gitlab.com' + + include_context 'bulk imports requests context', source_url + it 'successfully connects to remote instance' do - source_url = 'https://gitlab.com' pat = 'demo-pat' - stub_path = 'stub-group' - total = 37 - - stub_request(:get, "%{url}/api/v4/groups?page=1&per_page=20&top_level_only=true&min_access_level=50&search=" % { url: source_url }).to_return( - body: [{ - id: 2595438, - web_url: 'https://gitlab.com/groups/auto-breakfast', - name: 'Stub', - path: stub_path, - full_name: 'Stub', - full_path: stub_path - }].to_json, - headers: { - 'Content-Type' => 'application/json', - 'X-Next-Page' => 2, - 'X-Page' => 1, - 'X-Per-Page' => 20, - 'X-Total' => total, - 'X-Total-Pages' => 2 - } - ) - - allow_next_instance_of(BulkImports::Clients::HTTP) do |client| - allow(client).to receive(:validate_instance_version!).and_return(true) - end expect(page).to have_content 'Import groups from another instance of GitLab' expect(page).to have_content 'Not all related objects are migrated' @@ -56,8 +34,8 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do click_on 'Connect instance' - expect(page).to have_content 'Showing 1-1 of %{total} groups from %{url}' % { url: source_url, total: total } - expect(page).to have_content stub_path + expect(page).to have_content 'Showing 1-1 of 42 groups from %{url}' % { url: source_url } + expect(page).to have_content 'stub-group' visit '/' diff --git a/spec/features/groups/import_export/migration_history_spec.rb b/spec/features/groups/import_export/migration_history_spec.rb new file mode 100644 index 00000000000..243bdcc13a9 --- /dev/null +++ b/spec/features/groups/import_export/migration_history_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Import/Export - GitLab migration history', :js do + let_it_be(:user) { create(:user) } + + let_it_be(:user_import_1) { create(:bulk_import, user: user) } + let_it_be(:finished_entity_1) { create(:bulk_import_entity, :finished, bulk_import: user_import_1) } + + let_it_be(:user_import_2) { create(:bulk_import, user: user) } + let_it_be(:failed_entity_2) { create(:bulk_import_entity, :failed, bulk_import: user_import_2) } + + before do + gitlab_sign_in(user) + + visit new_group_path + + click_link 'Import group' + end + + it 'successfully displays import history' do + click_link 'History' + + wait_for_requests + + expect(page).to have_content 'Group import history' + expect(page.find('tbody')).to have_css('tr', count: 2) + end +end |