Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-14 15:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-14 15:09:34 +0300
commit9a5dcad39c5dd81384ae4ec2398435883b944363 (patch)
tree3c684d30e4500028299d7948171e885b844a1ade /spec/presenters/alert_management
parent0923a94d58cdd15cdb6379330e5eb41d30ccb8cc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters/alert_management')
-rw-r--r--spec/presenters/alert_management/alert_presenter_spec.rb27
-rw-r--r--spec/presenters/alert_management/prometheus_alert_presenter_spec.rb6
2 files changed, 30 insertions, 3 deletions
diff --git a/spec/presenters/alert_management/alert_presenter_spec.rb b/spec/presenters/alert_management/alert_presenter_spec.rb
index 365dc84ff53..3b7920dfd5e 100644
--- a/spec/presenters/alert_management/alert_presenter_spec.rb
+++ b/spec/presenters/alert_management/alert_presenter_spec.rb
@@ -9,7 +9,14 @@ RSpec.describe AlertManagement::AlertPresenter do
{
'title' => 'Alert title',
'start_time' => '2020-04-27T10:10:22.265949279Z',
- 'custom' => { 'param' => 73 }
+ 'custom' => {
+ 'alert' => {
+ 'fields' => %w[one two]
+ }
+ },
+ 'yet' => {
+ 'another' => 73
+ }
}
end
@@ -37,7 +44,10 @@ RSpec.describe AlertManagement::AlertPresenter do
#### Alert Details
- **custom.param:** 73
+ **title:** Alert title#{markdown_line_break}
+ **start_time:** 2020-04-27T10:10:22.265949279Z#{markdown_line_break}
+ **custom.alert.fields:** ["one", "two"]#{markdown_line_break}
+ **yet.another:** 73
MARKDOWN
)
end
@@ -54,4 +64,17 @@ RSpec.describe AlertManagement::AlertPresenter do
expect(presenter.details_url).to match(%r{#{project.web_url}/-/alert_management/#{alert.iid}/details})
end
end
+
+ describe '#details' do
+ subject { presenter.details }
+
+ it 'renders the payload as inline hash' do
+ is_expected.to eq(
+ 'title' => 'Alert title',
+ 'start_time' => '2020-04-27T10:10:22.265949279Z',
+ 'custom.alert.fields' => %w[one two],
+ 'yet.another' => 73
+ )
+ end
+ end
end
diff --git a/spec/presenters/alert_management/prometheus_alert_presenter_spec.rb b/spec/presenters/alert_management/prometheus_alert_presenter_spec.rb
index 8ff51b9a8e1..74c77b70e5a 100644
--- a/spec/presenters/alert_management/prometheus_alert_presenter_spec.rb
+++ b/spec/presenters/alert_management/prometheus_alert_presenter_spec.rb
@@ -38,7 +38,11 @@ RSpec.describe AlertManagement::PrometheusAlertPresenter do
#### Alert Details
- **custom annotation:** custom annotation value
+ **annotations.custom annotation:** custom annotation value#{markdown_line_break}
+ **annotations.gitlab_incident_markdown:** **`markdown example`**#{markdown_line_break}
+ **annotations.title:** Alert title#{markdown_line_break}
+ **startsAt:** 2020-04-27T10:10:22.265949279Z#{markdown_line_break}
+ **generatorURL:** http://8d467bd4607a:9090/graph?g0.expr=vector%281%29&g0.tab=1
---