Commit 85b0240c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add feature specs for manifest import

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4cee5d2e
class Import::ManifestController < Import::BaseController class Import::ManifestController < Import::BaseController
before_action :whitelist_query_limiting, only: [:create]
before_action :verify_import_enabled before_action :verify_import_enabled
before_action :ensure_import_vars, only: [:create, :status] before_action :ensure_import_vars, only: [:create, :status]
...@@ -85,4 +86,8 @@ class Import::ManifestController < Import::BaseController ...@@ -85,4 +86,8 @@ class Import::ManifestController < Import::BaseController
def verify_import_enabled def verify_import_enabled
render_404 unless manifest_import_enabled? render_404 unless manifest_import_enabled?
end end
def whitelist_query_limiting
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/48939')
end
end end
...@@ -17,7 +17,7 @@ module Gitlab ...@@ -17,7 +17,7 @@ module Gitlab
ImportSource.new('git', 'Repo by URL', nil), ImportSource.new('git', 'Repo by URL', nil),
ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer), ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer),
ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer), ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer),
ImportSource.new('manifest', 'Manifest file', Gitlab::ManifestImport::Importer) ImportSource.new('manifest', 'Manifest file', nil)
].freeze ].freeze
class << self class << self
......
require 'spec_helper' 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 include Select2Helper
let(:user) { create(:admin) } let(:user) { create(:admin) }
...@@ -12,7 +12,7 @@ feature 'Import multiple repositories by uploading a manifest file' do ...@@ -12,7 +12,7 @@ feature 'Import multiple repositories by uploading a manifest file' do
group.add_owner(user) group.add_owner(user)
end end
it 'parses manifest file and list repositories', :js do it 'parses manifest file and list repositories' do
visit new_import_manifest_path visit new_import_manifest_path
attach_file('manifest', Rails.root.join('spec/fixtures/aosp_manifest.xml')) 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 ...@@ -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_button('Import all repositories')
expect(page).to have_content('https://android-review.googlesource.com/platform/build/blueprint') expect(page).to have_content('https://android-review.googlesource.com/platform/build/blueprint')
end 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 end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment