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
714454c1
Commit
714454c1
authored
Sep 06, 2019
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `dig` for Hash lookup
parent
6ece98d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ee/lib/gitlab/alerting/notification_payload_parser.rb
ee/lib/gitlab/alerting/notification_payload_parser.rb
+1
-1
ee/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb
...c/lib/gitlab/alerting/notification_payload_parser_spec.rb
+2
-2
No files found.
ee/lib/gitlab/alerting/notification_payload_parser.rb
View file @
714454c1
...
...
@@ -39,7 +39,7 @@ module Gitlab
end
def
hosts
payload
[
:hosts
]
&&
Array
(
payload
[
:hosts
])
payload
[
:hosts
]
.
presence
&&
Array
(
payload
[
:hosts
])
end
def
current_time
...
...
ee/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb
View file @
714454c1
...
...
@@ -39,7 +39,7 @@ describe Gitlab::Alerting::NotificationPayloadParser do
end
it
'sets a predefined title'
do
expect
(
subject
[
'annotations'
][
'title'
]
).
to
eq
(
'New: Incident'
)
expect
(
subject
.
dig
(
'annotations'
,
'title'
)
).
to
eq
(
'New: Incident'
)
end
end
...
...
@@ -49,7 +49,7 @@ describe Gitlab::Alerting::NotificationPayloadParser do
end
it
'returns hosts as an array of one element'
do
expect
(
subject
[
'annotations'
][
'hosts'
]
).
to
eq
([
'gitlab.com'
])
expect
(
subject
.
dig
(
'annotations'
,
'hosts'
)
).
to
eq
([
'gitlab.com'
])
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