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
7c604bd6
Commit
7c604bd6
authored
Dec 29, 2021
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple spec for metrics_controller
To add basic coverage
parent
8b9dd104
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
spec/controllers/projects/prometheus/metrics_controller_spec.rb
...ontrollers/projects/prometheus/metrics_controller_spec.rb
+16
-0
No files found.
spec/controllers/projects/prometheus/metrics_controller_spec.rb
View file @
7c604bd6
...
...
@@ -157,6 +157,22 @@ RSpec.describe Projects::Prometheus::MetricsController do
end
end
describe
'PUT #update'
do
context
'metric is updated'
do
let_it_be
(
:metric
)
{
create
(
:prometheus_metric
,
project:
project
)
}
let
(
:metric_params
)
{
{
prometheus_metric:
{
title:
'new_title'
},
id:
metric
.
id
}
}
it
'shows a success flash message'
do
put
:update
,
params:
project_params
(
metric_params
)
expect
(
metric
.
reload
.
title
).
to
eq
(
'new_title'
)
expect
(
flash
[
:notice
]).
to
include
(
'Metric was successfully updated.'
)
expect
(
response
).
to
redirect_to
(
edit_project_integration_path
(
project
,
::
Integrations
::
Prometheus
))
end
end
end
describe
'DELETE #destroy'
do
context
'format html'
do
let!
(
:metric
)
{
create
(
:prometheus_metric
,
project:
project
)
}
...
...
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