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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
9bac3bfc
Commit
9bac3bfc
authored
Mar 30, 2017
by
Douglas Barbosa Alexandre
Committed by
Robert Speicher
Mar 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow users to import GitHub projects to subgroups
parent
6ff5e7f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
app/controllers/import/base_controller.rb
app/controllers/import/base_controller.rb
+1
-1
changelogs/unreleased/30289-allow-users-to-import-github-projects-to-subgroups.yml
...89-allow-users-to-import-github-projects-to-subgroups.yml
+4
-0
spec/support/controllers/githubish_import_controller_shared_examples.rb
...ontrollers/githubish_import_controller_shared_examples.rb
+14
-0
No files found.
app/controllers/import/base_controller.rb
View file @
9bac3bfc
...
...
@@ -11,7 +11,7 @@ class Import::BaseController < ApplicationController
namespace
.
add_owner
(
current_user
)
namespace
rescue
ActiveRecord
::
RecordNotUnique
,
ActiveRecord
::
RecordInvalid
Namespace
.
find_by_
path_or_name
(
name
)
Namespace
.
find_by_
full_path
(
name
)
end
end
end
changelogs/unreleased/30289-allow-users-to-import-github-projects-to-subgroups.yml
0 → 100644
View file @
9bac3bfc
---
title
:
Allow users to import GitHub projects to subgroups
merge_request
:
author
:
spec/support/controllers/githubish_import_controller_shared_examples.rb
View file @
9bac3bfc
...
...
@@ -228,5 +228,19 @@ shared_examples 'a GitHub-ish import controller: POST create' do
post
:create
,
{
new_name:
test_name
,
format: :js
}
end
end
context
'user has chosen a nested namespace and name for the project'
do
let
(
:parent_namespace
)
{
create
(
:namespace
,
name:
'foo'
,
owner:
user
)
}
let
(
:nested_namespace
)
{
create
(
:namespace
,
name:
'bar'
,
parent:
parent_namespace
,
owner:
user
)
}
let
(
:test_name
)
{
'test_name'
}
it
'takes the selected namespace and name'
do
expect
(
Gitlab
::
GithubImport
::
ProjectCreator
).
to
receive
(
:new
).
with
(
provider_repo
,
test_name
,
nested_namespace
,
user
,
access_params
,
type:
provider
).
and_return
(
double
(
execute:
true
))
post
:create
,
{
target_namespace:
nested_namespace
.
full_path
,
new_name:
test_name
,
format: :js
}
end
end
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