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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
649d23b9
Commit
649d23b9
authored
Apr 08, 2019
by
Felipe Artur
Committed by
Rémy Coutable
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE specific files/lines for spec/controllers/groups
This is part of moving gitlab into single codebase.
parent
f16112e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
21 deletions
+35
-21
ee/spec/controllers/groups/group_members_controller_spec.rb
ee/spec/controllers/groups/group_members_controller_spec.rb
+34
-0
spec/controllers/groups/boards_controller_spec.rb
spec/controllers/groups/boards_controller_spec.rb
+1
-1
spec/controllers/groups/group_members_controller_spec.rb
spec/controllers/groups/group_members_controller_spec.rb
+0
-20
No files found.
ee/spec/controllers/groups/group_members_controller_spec.rb
View file @
649d23b9
...
...
@@ -31,6 +31,14 @@ describe Groups::GroupMembersController do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
it
'creates an audit event'
do
expect
do
post
:create
,
params:
{
group_id:
group
,
user_ids:
user
.
id
,
access_level:
Gitlab
::
Access
::
GUEST
}
end
.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
end
describe
'PUT #update'
do
...
...
@@ -82,6 +90,32 @@ describe Groups::GroupMembersController do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
context
'when member is not an owner'
do
it
'creates an audit event'
do
developer
=
create
(
:user
)
group
.
add_developer
(
developer
)
sign_in
(
developer
)
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
end
context
'when member is an owner'
do
it
'does not create an audit event'
do
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
not_to
change
(
AuditEvent
,
:count
)
end
end
context
'when member requested access'
do
it
'creates an audit event'
do
requester
=
create
(
:user
)
group
.
request_access
(
requester
)
sign_in
(
requester
)
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
end
end
describe
'POST #resend_invite'
do
...
...
spec/controllers/groups/boards_controller_spec.rb
View file @
649d23b9
...
...
@@ -55,7 +55,7 @@ describe Groups::BoardsController do
context
'when format is JSON'
do
it
'return an array with one group board'
do
create
(
:board
,
group:
group
,
milestone:
create
(
:milestone
,
group:
group
)
)
create
(
:board
,
group:
group
)
expect
(
Boards
::
Visits
::
LatestService
).
not_to
receive
(
:new
)
...
...
spec/controllers/groups/group_members_controller_spec.rb
View file @
649d23b9
...
...
@@ -54,14 +54,6 @@ describe Groups::GroupMembersController do
expect
(
group
.
users
).
to
include
group_user
end
it
'creates an audit event'
do
expect
do
post
:create
,
params:
{
group_id:
group
,
user_ids:
group_user
.
id
,
access_level:
Gitlab
::
Access
::
GUEST
}
end
.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
it
'adds no user to members'
do
post
:create
,
params:
{
group_id:
group
,
...
...
@@ -182,10 +174,6 @@ describe Groups::GroupMembersController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'notice'
]).
to
eq
"You left the
\"
#{
group
.
name
}
\"
group."
end
it
'creates an audit event'
do
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
end
context
'and is an owner'
do
...
...
@@ -198,10 +186,6 @@ describe Groups::GroupMembersController do
expect
(
response
).
to
have_gitlab_http_status
(
403
)
end
it
'does not create an audit event'
do
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
not_to
change
(
AuditEvent
,
:count
)
end
end
context
'and is a requester'
do
...
...
@@ -217,10 +201,6 @@ describe Groups::GroupMembersController do
expect
(
group
.
requesters
).
to
be_empty
expect
(
group
.
users
).
not_to
include
user
end
it
'creates an audit event'
do
expect
{
delete
:leave
,
params:
{
group_id:
group
}
}.
to
change
(
AuditEvent
,
:count
).
by
(
1
)
end
end
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