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
6e1b4e72
Commit
6e1b4e72
authored
Jun 29, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix controller spec wth AM alerts
parent
d6960ecc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
ee/spec/controllers/operations_controller_spec.rb
ee/spec/controllers/operations_controller_spec.rb
+7
-7
No files found.
ee/spec/controllers/operations_controller_spec.rb
View file @
6e1b4e72
...
...
@@ -97,15 +97,15 @@ RSpec.describe OperationsController do
let!
(
:alert_events
)
do
[
create
(
:
prometheus_alert_event
,
prometheus_alert:
alert1
),
create
(
:
prometheus_alert_event
,
prometheus_alert:
alert2
),
create
(
:
prometheus_alert_event
,
prometheus_alert:
alert1
),
create
(
:
prometheus_alert_event
,
:resolved
,
prometheus_alert:
alert2
)
create
(
:
alert_management_alert
,
prometheus_alert:
alert1
,
project:
project
,
environment:
environment
),
create
(
:
alert_management_alert
,
prometheus_alert:
alert2
,
project:
project
,
environment:
environment
),
create
(
:
alert_management_alert
,
prometheus_alert:
alert1
,
project:
project
,
environment:
environment
),
create
(
:
alert_management_alert
,
:resolved
,
prometheus_alert:
alert2
,
project:
project
,
environment:
environment
)
]
end
let
(
:
firing_alert_events
)
{
alert_events
.
select
(
&
:firing
?
)
}
let
(
:last_firing_alert
)
{
firing_alert_even
ts
.
last
.
prometheus_alert
}
let
(
:
open_alerts
)
{
alert_events
.
select
(
&
:triggered?
)
+
alert_events
.
select
(
&
:acknowledged
?
)
}
let
(
:last_firing_alert
)
{
open_aler
ts
.
last
.
prometheus_alert
}
let
(
:alert_path
)
do
metrics_project_environment_path
(
project
,
environment
)
...
...
@@ -135,7 +135,7 @@ RSpec.describe OperationsController do
expect
(
expected_project
[
'remove_path'
])
.
to
eq
(
remove_operations_project_path
(
project_id:
project
.
id
))
expect
(
expected_project
[
'last_deployment'
][
'id'
]).
to
eq
(
deployment
.
id
)
expect
(
expected_project
[
'alert_count'
]).
to
eq
(
firing_alert_even
ts
.
size
)
expect
(
expected_project
[
'alert_count'
]).
to
eq
(
open_aler
ts
.
size
)
expect
(
expected_project
[
'alert_path'
]).
to
eq
(
alert_path
)
expect
(
expected_project
[
'last_alert'
][
'id'
]).
to
eq
(
last_firing_alert
.
id
)
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