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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
api.rb
lib/api.rb
+3
-3
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