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
Léo-Paul Géneau
gitlab-ce
Commits
8a340818
Commit
8a340818
authored
Sep 08, 2012
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move "users" test after project tests
parent
2e76342d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+27
-27
No files found.
spec/requests/api/projects_spec.rb
View file @
8a340818
...
@@ -67,33 +67,6 @@ describe Gitlab::API do
...
@@ -67,33 +67,6 @@ describe Gitlab::API do
end
end
end
end
describe
"POST /projects/:id/users"
do
it
"should add users to project"
do
expect
{
post
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
user2
.
id
,
"1"
=>
user3
.
id
},
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
2
)
end
end
describe
"PUT /projects/:id/users"
do
it
"should update users to new access role"
do
expect
{
put
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
user
},
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
1
)
end
end
describe
"DELETE /projects/:id/users"
do
it
"should delete users from project"
do
expect
{
delete
api
(
"/projects/
#{
project
.
code
}
/delete"
,
user
),
user_ids:
{
"0"
=>
users_project
.
id
}
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
-
1
)
end
end
describe
"GET /projects/:id"
do
describe
"GET /projects/:id"
do
it
"should return a project by id"
do
it
"should return a project by id"
do
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
...
@@ -134,6 +107,33 @@ describe Gitlab::API do
...
@@ -134,6 +107,33 @@ describe Gitlab::API do
end
end
end
end
describe
"POST /projects/:id/users"
do
it
"should add users to project"
do
expect
{
post
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
user2
.
id
,
"1"
=>
user3
.
id
},
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
2
)
end
end
describe
"PUT /projects/:id/users"
do
it
"should update users to new access role"
do
expect
{
put
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
user
},
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
1
)
end
end
describe
"DELETE /projects/:id/users"
do
it
"should delete users from project"
do
expect
{
delete
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
users_project
.
id
}
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
-
1
)
end
end
describe
"GET /projects/:id/repository/tags"
do
describe
"GET /projects/:id/repository/tags"
do
it
"should return an array of project tags"
do
it
"should return an array of project tags"
do
get
api
(
"/projects/
#{
project
.
code
}
/repository/tags"
,
user
)
get
api
(
"/projects/
#{
project
.
code
}
/repository/tags"
,
user
)
...
...
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