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
Kazuhiko Shiozaki
gitlab-ce
Commits
80097606
Commit
80097606
authored
Apr 15, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure user has access to namespace in import tests.
parent
9193b94e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
37 deletions
+62
-37
lib/gitlab/gitorious_import/client.rb
lib/gitlab/gitorious_import/client.rb
+0
-32
lib/gitlab/gitorious_import/repository.rb
lib/gitlab/gitorious_import/repository.rb
+37
-0
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
+5
-1
spec/lib/gitlab/github_import/project_creator_spec.rb
spec/lib/gitlab/github_import/project_creator_spec.rb
+5
-1
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+5
-1
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
+5
-1
spec/lib/gitlab/google_code_import/project_creator_spec.rb
spec/lib/gitlab/google_code_import/project_creator_spec.rb
+5
-1
No files found.
lib/gitlab/gitorious_import/client.rb
View file @
80097606
...
@@ -27,37 +27,5 @@ module Gitlab
...
@@ -27,37 +27,5 @@ module Gitlab
repo_list
.
to_s
.
split
(
','
).
map
(
&
:strip
).
reject
(
&
:blank?
)
repo_list
.
to_s
.
split
(
','
).
map
(
&
:strip
).
reject
(
&
:blank?
)
end
end
end
end
Repository
=
Struct
.
new
(
:full_name
)
do
def
id
Digest
::
SHA1
.
hexdigest
(
full_name
)
end
def
namespace
segments
.
first
end
def
path
segments
.
last
end
def
name
path
.
titleize
end
def
description
""
end
def
import_url
"
#{
GITORIOUS_HOST
}
/
#{
full_name
}
.git"
end
private
def
segments
full_name
.
split
(
'/'
)
end
end
end
end
end
end
lib/gitlab/gitorious_import/repository.rb
0 → 100644
View file @
80097606
module
Gitlab
module
GitoriousImport
GITORIOUS_HOST
=
"https://gitorious.org"
Repository
=
Struct
.
new
(
:full_name
)
do
def
id
Digest
::
SHA1
.
hexdigest
(
full_name
)
end
def
namespace
segments
.
first
end
def
path
segments
.
last
end
def
name
path
.
titleize
end
def
description
""
end
def
import_url
"
#{
GITORIOUS_HOST
}
/
#{
full_name
}
.git"
end
private
def
segments
full_name
.
split
(
'/'
)
end
end
end
end
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
View file @
80097606
...
@@ -8,8 +8,12 @@ describe Gitlab::BitbucketImport::ProjectCreator do
...
@@ -8,8 +8,12 @@ describe Gitlab::BitbucketImport::ProjectCreator do
is_private:
true
,
is_private:
true
,
owner:
"asd"
}.
with_indifferent_access
owner:
"asd"
}.
with_indifferent_access
}
}
let
(
:namespace
){
create
(
:
namespace
)
}
let
(
:namespace
){
create
(
:
group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
...
...
spec/lib/gitlab/github_import/project_creator_spec.rb
View file @
80097606
...
@@ -10,7 +10,11 @@ describe Gitlab::GithubImport::ProjectCreator do
...
@@ -10,7 +10,11 @@ describe Gitlab::GithubImport::ProjectCreator do
clone_url:
"https://gitlab.com/asd/vim.git"
,
clone_url:
"https://gitlab.com/asd/vim.git"
,
owner:
OpenStruct
.
new
(
login:
"john"
))
owner:
OpenStruct
.
new
(
login:
"john"
))
}
}
let
(
:namespace
){
create
(
:namespace
)
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
...
...
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
View file @
80097606
...
@@ -10,7 +10,11 @@ describe Gitlab::GitlabImport::ProjectCreator do
...
@@ -10,7 +10,11 @@ describe Gitlab::GitlabImport::ProjectCreator do
http_url_to_repo:
"https://gitlab.com/asd/vim.git"
,
http_url_to_repo:
"https://gitlab.com/asd/vim.git"
,
owner:
{
name:
"john"
}}.
with_indifferent_access
owner:
{
name:
"john"
}}.
with_indifferent_access
}
}
let
(
:namespace
){
create
(
:namespace
)
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
...
...
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
View file @
80097606
...
@@ -3,7 +3,11 @@ require 'spec_helper'
...
@@ -3,7 +3,11 @@ require 'spec_helper'
describe
Gitlab
::
GitoriousImport
::
ProjectCreator
do
describe
Gitlab
::
GitoriousImport
::
ProjectCreator
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:repo
)
{
Gitlab
::
GitoriousImport
::
Repository
.
new
(
'foo/bar-baz-qux'
)
}
let
(
:repo
)
{
Gitlab
::
GitoriousImport
::
Repository
.
new
(
'foo/bar-baz-qux'
)
}
let
(
:namespace
){
create
(
:namespace
)
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
...
...
spec/lib/gitlab/google_code_import/project_creator_spec.rb
View file @
80097606
...
@@ -9,7 +9,11 @@ describe Gitlab::GoogleCodeImport::ProjectCreator do
...
@@ -9,7 +9,11 @@ describe Gitlab::GoogleCodeImport::ProjectCreator do
"repositoryUrls"
=>
[
"https://vim.googlecode.com/git/"
]
"repositoryUrls"
=>
[
"https://vim.googlecode.com/git/"
]
)
)
}
}
let
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
...
...
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