Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gitlab-External-Templates
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adri
Gitlab-External-Templates
Commits
dc0e63b5
Unverified
Commit
dc0e63b5
authored
5 years ago
by
Douglas Barbosa Alexandre
Browse files
Options
Downloads
Patches
Plain Diff
Fix spec for IncidentManagement::ProcessPrometheusAlertWorker
parent
0f8d271f
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ee/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb
+7
-8
7 additions, 8 deletions
...cident_management/process_prometheus_alert_worker_spec.rb
with
7 additions
and
8 deletions
ee/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb
+
7
−
8
View file @
dc0e63b5
...
...
@@ -23,24 +23,23 @@
it
'creates an issue'
do
expect
{
subject
.
perform
(
project
.
id
,
alert_params
)
}
.
to
change
(
Issue
,
:count
)
.
by
(
1
)
.
to
change
{
project
.
reload
.
issues
.
count
}.
from
(
0
).
to
(
1
)
end
it
'relates issue to an event'
do
expect
{
subject
.
perform
(
project
.
id
,
alert_params
)
}
.
to
change
(
prometheus_alert
.
related_issues
,
:
count
)
.
from
(
0
).
to
(
1
)
.
to
change
{
prometheus_alert
.
reload
.
related_issues
.
count
}
.
from
(
0
).
to
(
1
)
end
context
'when project could not be found'
do
it
'does not create an issue'
do
expect
{
subject
.
perform
(
'1234'
,
alert_params
)
}
.
not_to
change
(
I
ssue
,
:
count
)
.
not_to
change
{
project
.
reload
.
i
ssue
s
.
count
}
end
it
'does not relate issue to an event'
do
expect
{
subject
.
perform
(
'1234'
,
alert_params
)
}
.
not_to
change
(
prometheus_alert
.
related_issues
,
:
count
)
.
not_to
change
{
prometheus_alert
.
reload
.
related_issues
.
count
}
end
end
...
...
@@ -51,12 +50,12 @@
it
'does not create an issue'
do
expect
{
subject
.
perform
(
project
.
id
,
alert_params
)
}
.
not_to
change
(
I
ssue
,
:
count
)
.
not_to
change
{
project
.
reload
.
i
ssue
s
.
count
}
end
it
'does not relate issue to an event'
do
expect
{
subject
.
perform
(
project
.
id
,
alert_params
)
}
.
not_to
change
(
I
ssue
,
:
count
)
.
not_to
change
{
prometheus_alert
.
reload
.
related_i
ssue
s
.
count
}
end
end
...
...
@@ -69,7 +68,7 @@
it
'does not relate issue to an event'
do
expect
{
subject
.
perform
(
project
.
id
,
alert_params
)
}
.
not_to
change
(
prometheus_alert
.
related_issues
,
:
count
)
.
not_to
change
{
prometheus_alert
.
reload
.
related_issues
.
count
}
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment