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
c180f007
Commit
c180f007
authored
Sep 18, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ssh key event and spec
parent
16abde42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
app/models/key.rb
app/models/key.rb
+2
-0
spec/controllers/profiles/keys_controller_spec.rb
spec/controllers/profiles/keys_controller_spec.rb
+10
-0
No files found.
app/models/key.rb
View file @
c180f007
...
...
@@ -28,6 +28,8 @@ class Key < ActiveRecord::Base
delegate
:name
,
:email
,
to: :user
,
prefix:
true
alias_attribute
:full_path
,
:title
after_commit
:add_to_shell
,
on: :create
after_create
:post_create_hook
after_commit
:remove_from_shell
,
on: :destroy
...
...
spec/controllers/profiles/keys_controller_spec.rb
View file @
c180f007
...
...
@@ -66,4 +66,14 @@ describe Profiles::KeysController do
end
end
end
describe
'#create'
do
it
'logs the audit event'
do
sign_in
(
user
)
key
=
build
(
:key
)
expect
{
post
:create
,
key:
key
.
attributes
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
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