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
f2b624e5
Commit
f2b624e5
authored
Sep 15, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix details and details spec
parent
bbecfdfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
lib/audit/details.rb
lib/audit/details.rb
+8
-1
spec/lib/audit/details_spec.rb
spec/lib/audit/details_spec.rb
+18
-0
No files found.
lib/audit/details.rb
View file @
f2b624e5
...
...
@@ -32,7 +32,14 @@ module Audit
when
:failed_login
"Failed to login with
#{
Gitlab
::
OAuth
::
Provider
.
label_for
(
value
).
upcase
}
authentication"
else
"Changed
#{
value
}
from
#{
@details
[
:from
]
}
to
#{
@details
[
:to
]
}
"
text_for_change
(
value
)
end
end
def
text_for_change
(
value
)
"Changed
#{
value
}
"
.
tap
do
|
changed_string
|
changed_string
<<
" from
#{
@details
[
:from
]
}
"
if
@details
[
:from
]
changed_string
<<
" to
#{
@details
[
:to
]
}
"
if
@details
[
:to
]
end
end
end
...
...
spec/lib/audit/details_spec.rb
View file @
f2b624e5
...
...
@@ -75,5 +75,23 @@ describe Audit::Details do
expect
(
described_class
.
humanize
(
removal_action
)).
to
eq
(
'Removed deploy key'
)
end
end
context
'change email'
do
let
(
:action
)
do
{
change:
'email'
,
from:
'a@b.com'
,
to:
'c@b.com'
,
author_name:
'author'
,
target_id:
''
,
target_type:
'Email'
,
target_details:
'Email'
}
end
it
'humanizes the removal action'
do
expect
(
described_class
.
humanize
(
action
)).
to
eq
(
'Removed deploy key'
)
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