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
84a3f8fc
Commit
84a3f8fc
authored
Jun 28, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show only current user projects
parent
7b5c3cc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
lib/api.rb
lib/api.rb
+3
-3
spec/api/projects_spec.rb
spec/api/projects_spec.rb
+1
-2
No files found.
lib/api.rb
View file @
84a3f8fc
...
@@ -41,19 +41,19 @@ module Gitlab
...
@@ -41,19 +41,19 @@ module Gitlab
# GET /projects/:id
# GET /projects/:id
get
":id"
do
get
":id"
do
@project
=
Project
.
find_by_code
(
params
[
:id
])
@project
=
current_user
.
projects
.
find_by_code
(
params
[
:id
])
present
@project
,
:with
=>
Entities
::
Project
present
@project
,
:with
=>
Entities
::
Project
end
end
# GET /projects/:id/repository/branches
# GET /projects/:id/repository/branches
get
":id/repository/branches"
do
get
":id/repository/branches"
do
@project
=
Project
.
find_by_code
(
params
[
:id
])
@project
=
current_user
.
projects
.
find_by_code
(
params
[
:id
])
present
@project
.
repo
.
heads
.
sort_by
(
&
:name
),
:with
=>
Entities
::
ProjectRepositoryBranches
present
@project
.
repo
.
heads
.
sort_by
(
&
:name
),
:with
=>
Entities
::
ProjectRepositoryBranches
end
end
# GET /projects/:id/repository/tags
# GET /projects/:id/repository/tags
get
":id/repository/tags"
do
get
":id/repository/tags"
do
@project
=
Project
.
find_by_code
(
params
[
:id
])
@project
=
current_user
.
projects
.
find_by_code
(
params
[
:id
])
present
@project
.
repo
.
tags
.
sort_by
(
&
:name
).
reverse
,
:with
=>
Entities
::
ProjectRepositoryTags
present
@project
.
repo
.
tags
.
sort_by
(
&
:name
).
reverse
,
:with
=>
Entities
::
ProjectRepositoryTags
end
end
end
end
...
...
spec/api/projects_spec.rb
View file @
84a3f8fc
...
@@ -3,10 +3,9 @@ require 'spec_helper'
...
@@ -3,10 +3,9 @@ require 'spec_helper'
describe
Gitlab
::
API
do
describe
Gitlab
::
API
do
let
(
:user
)
{
Factory
:user
}
let
(
:user
)
{
Factory
:user
}
let!
(
:project
)
{
Factory
:project
,
:owner
=>
user
}
let!
(
:project
)
{
Factory
:project
,
:owner
=>
user
}
before
{
project
.
add_access
(
user
,
:read
)
}
describe
"GET /projects"
do
describe
"GET /projects"
do
before
{
project
.
add_access
(
user
,
:read
)
}
it
"should return authentication error"
do
it
"should return authentication error"
do
get
"/api/projects"
get
"/api/projects"
response
.
status
.
should
==
401
response
.
status
.
should
==
401
...
...
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