Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
85b0240c
Commit
85b0240c
authored
Jul 06, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for manifest import
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
4cee5d2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
app/controllers/import/manifest_controller.rb
app/controllers/import/manifest_controller.rb
+5
-0
lib/gitlab/import_sources.rb
lib/gitlab/import_sources.rb
+1
-1
spec/features/import/manifest_import_spec.rb
spec/features/import/manifest_import_spec.rb
+20
-2
No files found.
app/controllers/import/manifest_controller.rb
View file @
85b0240c
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
lib/gitlab/import_sources.rb
View file @
85b0240c
...
...
@@ -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
...
...
spec/features/import/manifest_import_spec.rb
View file @
85b0240c
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment