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
6c0f34bf
Commit
6c0f34bf
authored
Jul 10, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved readability of modified rspec
parent
7f3c827a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
ee/spec/helpers/audit_events_helper_spec.rb
ee/spec/helpers/audit_events_helper_spec.rb
+4
-7
ee/spec/lib/audit/details_spec.rb
ee/spec/lib/audit/details_spec.rb
+13
-6
No files found.
ee/spec/helpers/audit_events_helper_spec.rb
View file @
6c0f34bf
...
...
@@ -31,15 +31,12 @@ describe AuditEventsHelper do
expect
(
subject
).
to
eq
(
custom_message
)
end
context
'when the target_type is Operations::FeatureFlag'
do
context
'when message relates to feature flags'
do
let
(
:custom_message
)
{
"Feature flag my_feature_flag was updated"
}
let
(
:target_type
)
{
'Operations::FeatureFlag'
}
context
'when custom message contains "_"'
do
let
(
:custom_message
)
{
"message_with_spaces"
}
it
'does not replace them with spaces'
do
expect
(
subject
).
to
eq
(
"message_with_spaces"
)
end
it
'shows message as is'
do
is_expected
.
to
eq
(
custom_message
)
end
end
...
...
ee/spec/lib/audit/details_spec.rb
View file @
6c0f34bf
...
...
@@ -67,14 +67,21 @@ describe Audit::Details do
expect
(
string
).
to
eq
(
'Changed access level from Guest to Owner'
)
end
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
)
context
'feature flag'
do
let
(
:feature_flag
)
do
{
remove:
'feature_flag'
,
target_type:
'Operations::FeatureFlag'
}
end
let
(
:custom_message
)
{
"Removed feature_flag"
}
expect
(
string
).
to
eq
(
'Changed access_level from Guest to Owner'
)
end
it
'shows message as is'
do
string
=
described_class
.
humanize
(
feature_flag
)
expect
(
string
).
to
eq
(
custom_message
)
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