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-19 04:45:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 04:45:44 +0300
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/lib/gitlab/alerting
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/lib/gitlab/alerting')
-rw-r--r--spec/lib/gitlab/alerting/notification_payload_parser_spec.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb b/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb
index 0489108b159..ff5ab1116fa 100644
--- a/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb
+++ b/spec/lib/gitlab/alerting/notification_payload_parser_spec.rb
@@ -7,10 +7,12 @@ RSpec.describe Gitlab::Alerting::NotificationPayloadParser do
describe '.call' do
let(:starts_at) { Time.current.change(usec: 0) }
+ let(:ends_at) { Time.current.change(usec: 0) }
let(:payload) do
{
'title' => 'alert title',
'start_time' => starts_at.rfc3339,
+ 'end_time' => ends_at.rfc3339,
'description' => 'Description',
'monitoring_tool' => 'Monitoring tool name',
'service' => 'Service',
@@ -32,7 +34,8 @@ RSpec.describe Gitlab::Alerting::NotificationPayloadParser do
'hosts' => ['gitlab.com'],
'severity' => 'low'
},
- 'startsAt' => starts_at.rfc3339
+ 'startsAt' => starts_at.rfc3339,
+ 'endsAt' => ends_at.rfc3339
}
)
end
@@ -124,11 +127,24 @@ RSpec.describe Gitlab::Alerting::NotificationPayloadParser do
end
end
+ context 'with environment' do
+ let(:environment) { create(:environment, project: project) }
+
+ before do
+ payload[:gitlab_environment_name] = environment.name
+ end
+
+ it 'sets the environment ' do
+ expect(subject.dig('annotations', 'environment')).to eq(environment)
+ end
+ end
+
context 'when payload attributes have blank lines' do
let(:payload) do
{
'title' => '',
'start_time' => '',
+ 'end_time' => '',
'description' => '',
'monitoring_tool' => '',
'service' => '',