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
8f56d7b1
Commit
8f56d7b1
authored
Jun 17, 2020
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate describe blocks for each test
parent
6e5f1607
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
ee/spec/requests/api/users_spec.rb
ee/spec/requests/api/users_spec.rb
+9
-9
No files found.
ee/spec/requests/api/users_spec.rb
View file @
8f56d7b1
...
...
@@ -82,22 +82,22 @@ RSpec.describe API::Users do
end
end
describe
'POST /keys'
do
let
(
:key_attrs
)
{
attributes_for
:key
}
def
make_request
(
endpoint
,
user
)
post
api
(
endpoint
,
user
),
params:
key_attrs
end
describe
'POST /user/keys'
do
it
'creates audit event when user adds a new SSH key'
do
key
=
attributes_for
(
:key
)
expect
do
make_request
(
"/user/keys"
,
user
)
post
api
(
'/user/keys'
,
user
),
params:
key
end
.
to
change
{
AuditEvent
.
count
}.
by
(
1
)
end
end
describe
'POST /users/:id/keys'
do
it
'creates audit event when admin adds a new key for a user'
do
key
=
attributes_for
(
:key
)
expect
do
make_request
(
"/users/
#{
user
.
id
}
/keys"
,
admin
)
post
api
(
"/users/
#{
user
.
id
}
/keys"
,
admin
),
params:
key
end
.
to
change
{
AuditEvent
.
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