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
f34a2599
Commit
f34a2599
authored
Jul 09, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed char substitution for event message in audit detail class
parent
5cc95e50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
ee/lib/audit/details.rb
ee/lib/audit/details.rb
+6
-1
ee/spec/lib/audit/details_spec.rb
ee/spec/lib/audit/details_spec.rb
+16
-4
No files found.
ee/lib/audit/details.rb
View file @
f34a2599
...
...
@@ -24,7 +24,6 @@ module Audit
def
action_text
action
=
@details
.
slice
(
*
ACTIONS
)
value
=
@details
.
values
.
first
.
tr
(
'_'
,
' '
)
case
action
.
keys
.
first
when
:add
...
...
@@ -48,5 +47,11 @@ module Audit
changed
.
join
(
' '
)
end
def
value
target_type
=
@details
[
:target_type
].
constantize
val
=
@details
.
values
.
first
target_type
==
Operations
::
FeatureFlag
?
val
:
val
.
tr
(
'_'
,
' '
)
end
end
end
ee/spec/lib/audit/details_spec.rb
View file @
f34a2599
...
...
@@ -47,6 +47,7 @@ describe Audit::Details do
let
(
:user_member
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:member
)
{
create
(
:group_member
,
group:
group
,
user:
user_member
)
}
let
(
:target_type
)
{
'User'
}
let
(
:member_access_action
)
do
{
change:
'access_level'
,
...
...
@@ -54,15 +55,26 @@ describe Audit::Details do
to:
member
.
human_access
,
author_name:
user
.
name
,
target_id:
member
.
id
,
target_type:
'User'
,
target_type:
target_type
,
target_details:
member
.
user
.
name
}
end
it
'humanizes add group member access action'
do
string
=
described_class
.
humanize
(
member_access_action
)
context
'when the target_type is not Operations::FeatureFlag'
do
it
'humanizes add group member access action'
do
string
=
described_class
.
humanize
(
member_access_action
)
expect
(
string
).
to
eq
(
'Changed access level from Guest to Owner'
)
end
end
context
'when the target_type is Operations::FeatureFlag'
do
let
(
:target_type
)
{
'Operations::FeatureFlag'
}
it
'leaves access_level as it is'
do
string
=
described_class
.
humanize
(
member_access_action
)
expect
(
string
).
to
eq
(
'Changed access level from Guest to Owner'
)
expect
(
string
).
to
eq
(
'Changed access_level from Guest to Owner'
)
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