BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
37 deletions
+62
-37
client.rb
lib/gitlab/gitorious_import/client.rb
+0
-32
repository.rb
lib/gitlab/gitorious_import/repository.rb
+37
-0
project_creator_spec.rb
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
+5
-1
project_creator_spec.rb
spec/lib/gitlab/github_import/project_creator_spec.rb
+5
-1
project_creator_spec.rb
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+5
-1
project_creator_spec.rb
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
+5
-1
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
repo_list
.
to_s
.
split
(
','
).
map
(
&
:strip
).
reject
(
&
:blank?
)
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
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
is_private:
true
,
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
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
clone_url:
"https://gitlab.com/asd/vim.git"
,
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
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
http_url_to_repo:
"https://gitlab.com/asd/vim.git"
,
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
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'
describe
Gitlab
::
GitoriousImport
::
ProjectCreator
do
let
(
:user
)
{
create
(
:user
)
}
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
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
"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
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