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
3730b067
Commit
3730b067
authored
Jul 12, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified AuditEventsHelper module and related rspec
parent
2dcf50da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
16 deletions
+1
-16
ee/app/helpers/audit_events_helper.rb
ee/app/helpers/audit_events_helper.rb
+1
-7
ee/spec/helpers/audit_events_helper_spec.rb
ee/spec/helpers/audit_events_helper_spec.rb
+0
-9
No files found.
ee/app/helpers/audit_events_helper.rb
View file @
3730b067
...
...
@@ -2,7 +2,7 @@
module
AuditEventsHelper
def
human_text
(
details
)
return
custom_message_for
(
details
)
if
details
[
:custom_message
]
return
details
[
:custom_message
]
if
details
[
:custom_message
]
details
.
map
{
|
key
,
value
|
select_keys
(
key
,
value
)
}.
join
(
" "
).
humanize
end
...
...
@@ -14,10 +14,4 @@ module AuditEventsHelper
"
#{
key
}
<strong>
#{
value
}
</strong>"
end
end
def
custom_message_for
(
details
)
target_type
=
details
[
:target_type
]
val
=
details
[
:custom_message
]
target_type
==
'Operations::FeatureFlag'
?
val
:
val
.
tr
(
'_'
,
' '
)
end
end
ee/spec/helpers/audit_events_helper_spec.rb
View file @
3730b067
...
...
@@ -30,15 +30,6 @@ describe AuditEventsHelper do
it
'returns custom message'
do
expect
(
subject
).
to
eq
(
custom_message
)
end
context
'when message relates to feature flags'
do
let
(
:custom_message
)
{
"Feature flag my_feature_flag was updated"
}
let
(
:target_type
)
{
'Operations::FeatureFlag'
}
it
'shows message as is'
do
is_expected
.
to
eq
(
custom_message
)
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