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
b5af4fb1
Commit
b5af4fb1
authored
Sep 04, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow importing groups projects
parent
8dc91cde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
lib/api/entities.rb
lib/api/entities.rb
+3
-3
spec/requests/api/v3/github_repos_spec.rb
spec/requests/api/v3/github_repos_spec.rb
+9
-1
No files found.
lib/api/entities.rb
View file @
b5af4fb1
...
@@ -1092,13 +1092,13 @@ module API
...
@@ -1092,13 +1092,13 @@ module API
end
end
module
Github
module
Github
class
User
<
Grape
::
Entity
class
Namespace
<
Grape
::
Entity
expose
:
username
expose
:
path
,
as: :login
end
end
class
Repository
<
Grape
::
Entity
class
Repository
<
Grape
::
Entity
expose
:id
expose
:id
expose
:
owner
,
using:
User
expose
:
namespace
,
as: :owner
,
using:
Namespace
expose
:name
expose
:name
end
end
...
...
spec/requests/api/v3/github_repos_spec.rb
View file @
b5af4fb1
...
@@ -40,13 +40,21 @@ describe API::V3::GithubRepos do
...
@@ -40,13 +40,21 @@ describe API::V3::GithubRepos do
describe
'GET /users/:id/repos'
do
describe
'GET /users/:id/repos'
do
context
'authenticated'
do
context
'authenticated'
do
it
'returns an array of projects with github format'
do
it
'returns an array of projects with github format'
do
group
=
create
(
:group
)
create
(
:project
,
group:
group
)
group
.
add_master
(
user
)
get
v3_api
(
"/users/whatever/repos"
,
user
)
get
v3_api
(
"/users/whatever/repos"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
).
to
be_an
(
Array
)
expect
(
json_response
).
to
be_an
(
Array
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
first
.
keys
).
to
contain_exactly
(
'id'
,
'owner'
,
'name'
)
expect
(
json_response
.
first
.
keys
).
to
contain_exactly
(
'id'
,
'owner'
,
'name'
)
expect
(
json_response
.
first
[
'owner'
].
keys
).
to
contain_exactly
(
'login'
)
expect
(
json_response
.
first
[
'owner'
].
keys
).
to
contain_exactly
(
'login'
)
expect
(
json_response
.
second
.
keys
).
to
contain_exactly
(
'id'
,
'owner'
,
'name'
)
expect
(
json_response
.
second
[
'owner'
].
keys
).
to
contain_exactly
(
'login'
)
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