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
Kazuhiko Shiozaki
gitlab-ce
Commits
499ff8b4
Commit
499ff8b4
authored
Sep 08, 2012
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failing tests
parent
0d1009af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+9
-8
No files found.
spec/requests/api/projects_spec.rb
View file @
499ff8b4
...
...
@@ -8,7 +8,8 @@ describe Gitlab::API do
let
(
:user3
)
{
Factory
.
create
(
:user
)
}
let!
(
:project
)
{
Factory
:project
,
owner:
user
}
let!
(
:snippet
)
{
Factory
:snippet
,
author:
user
,
project:
project
,
title:
'example'
}
let!
(
:users_project
)
{
Factory
:users_project
,
user:
user
,
project:
project
}
let!
(
:users_project
)
{
Factory
:users_project
,
user:
user
,
project:
project
,
project_access:
UsersProject
::
MASTER
}
let!
(
:users_project2
)
{
Factory
:users_project
,
user:
user3
,
project:
project
,
project_access:
UsersProject
::
DEVELOPER
}
before
{
project
.
add_access
(
user
,
:read
)
}
describe
"GET /projects"
do
...
...
@@ -114,7 +115,7 @@ describe Gitlab::API do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
count
.
should
==
1
json_response
.
count
.
should
==
2
json_response
.
first
[
'user'
][
'id'
].
should
==
user
.
id
end
end
...
...
@@ -123,8 +124,8 @@ describe Gitlab::API 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
)
user_ids:
{
"0"
=>
user2
.
id
},
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
1
)
end
end
...
...
@@ -132,8 +133,8 @@ describe Gitlab::API 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
::
DEVELOP
ER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOP
ER
).
count
}.
by
(
1
)
user_ids:
{
"0"
=>
user
3
.
id
},
project_access:
UsersProject
::
MAST
ER
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
MAST
ER
).
count
}.
by
(
1
)
end
end
...
...
@@ -141,8 +142,8 @@ describe Gitlab::API do
it
"should delete users from project"
do
expect
{
delete
api
(
"/projects/
#{
project
.
code
}
/users"
,
user
),
user_ids:
{
"0"
=>
user
s_project
.
id
}
}.
to
change
{
project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
-
1
)
user_ids:
{
"0"
=>
user
3
.
id
}
}.
to
change
{
project
.
users_projects
.
count
}.
by
(
-
1
)
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