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
43fba7f0
Commit
43fba7f0
authored
Oct 28, 2014
by
Dmitriy Zaporozhets
Committed by
Valery Sizov
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test that should be green after group members api get fixed
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
912715c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
groups_spec.rb
spec/requests/api/groups_spec.rb
+17
-3
No files found.
spec/requests/api/groups_spec.rb
View file @
43fba7f0
...
@@ -220,13 +220,27 @@ describe API::API, api: true do
...
@@ -220,13 +220,27 @@ describe API::API, api: true do
context
"when a member of the group"
do
context
"when a member of the group"
do
it
"should return ok and add new member"
do
it
"should return ok and add new member"
do
count_before
=
group_no_members
.
group_members
.
count
new_user
=
create
(
:user
)
new_user
=
create
(
:user
)
post
api
(
"/groups/
#{
group_no_members
.
id
}
/members"
,
owner
),
user_id:
new_user
.
id
,
access_level:
GroupMember
::
MASTER
expect
{
post
api
(
"/groups/
#{
group_no_members
.
id
}
/members"
,
owner
),
user_id:
new_user
.
id
,
access_level:
GroupMember
::
MASTER
}.
to
change
{
group_no_members
.
members
.
count
}.
by
(
1
)
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'name'
].
should
==
new_user
.
name
json_response
[
'name'
].
should
==
new_user
.
name
json_response
[
'access_level'
].
should
==
GroupMember
::
MASTER
json_response
[
'access_level'
].
should
==
GroupMember
::
MASTER
group_no_members
.
group_members
.
count
.
should
==
count_before
+
1
end
it
"should not allow guest to modify group members"
do
new_user
=
create
(
:user
)
expect
{
post
api
(
"/groups/
#{
group_with_members
.
id
}
/members"
,
guest
),
user_id:
new_user
.
id
,
access_level:
GroupMember
::
MASTER
}.
not_to
change
{
group_with_members
.
members
.
count
}
response
.
status
.
should
==
403
end
end
it
"should return error if member already exists"
do
it
"should return error if member already exists"
do
...
...
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