diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-06 15:06:44 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-11 12:22:57 +0300 |
commit | 85b0240c4b58a49b22c9dbff9451127ae817652a (patch) | |
tree | 1674729902e2c8a9041134e0ed581ad4c96d958a | |
parent | 4cee5d2e8c78001a1affc53175833641253adbb0 (diff) | |
download | gitlab-ce-85b0240c4b58a49b22c9dbff9451127ae817652a.tar.gz |
Add feature specs for manifest import
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/controllers/import/manifest_controller.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/import_sources.rb | 2 | ||||
-rw-r--r-- | spec/features/import/manifest_import_spec.rb | 22 |
3 files changed, 26 insertions, 3 deletions
diff --git a/app/controllers/import/manifest_controller.rb b/app/controllers/import/manifest_controller.rb index 1af686bfa83..0be9cc2468f 100644 --- a/app/controllers/import/manifest_controller.rb +++ b/app/controllers/import/manifest_controller.rb @@ -1,4 +1,5 @@ class Import::ManifestController < Import::BaseController + before_action :whitelist_query_limiting, only: [:create] before_action :verify_import_enabled before_action :ensure_import_vars, only: [:create, :status] @@ -85,4 +86,8 @@ class Import::ManifestController < Import::BaseController def verify_import_enabled render_404 unless manifest_import_enabled? end + + def whitelist_query_limiting + Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/48939') + end end diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb index 374420b9061..af9b880ef9e 100644 --- a/lib/gitlab/import_sources.rb +++ b/lib/gitlab/import_sources.rb @@ -17,7 +17,7 @@ module Gitlab ImportSource.new('git', 'Repo by URL', nil), ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer), ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer), - ImportSource.new('manifest', 'Manifest file', Gitlab::ManifestImport::Importer) + ImportSource.new('manifest', 'Manifest file', nil) ].freeze class << self diff --git a/spec/features/import/manifest_import_spec.rb b/spec/features/import/manifest_import_spec.rb index 8f5416c4c27..a0bb1df6fe2 100644 --- a/spec/features/import/manifest_import_spec.rb +++ b/spec/features/import/manifest_import_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Import multiple repositories by uploading a manifest file' do +feature 'Import multiple repositories by uploading a manifest file', :js do include Select2Helper let(:user) { create(:admin) } @@ -12,7 +12,7 @@ feature 'Import multiple repositories by uploading a manifest file' do group.add_owner(user) end - it 'parses manifest file and list repositories', :js do + it 'parses manifest file and list repositories' do visit new_import_manifest_path attach_file('manifest', Rails.root.join('spec/fixtures/aosp_manifest.xml')) @@ -21,4 +21,22 @@ feature 'Import multiple repositories by uploading a manifest file' do expect(page).to have_button('Import all repositories') expect(page).to have_content('https://android-review.googlesource.com/platform/build/blueprint') end + + it 'imports succesfully imports a project' do + visit new_import_manifest_path + + attach_file('manifest', Rails.root.join('spec/fixtures/aosp_manifest.xml')) + click_on 'Continue to the next step' + + page.within(first_row) do + click_on 'Import' + + expect(page).to have_content 'Done' + expect(page).to have_content("#{group.full_path}/build/make") + end + end + + def first_row + page.all('table.import-jobs tbody tr')[0] + end end |