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
1ab1a6ee
Commit
1ab1a6ee
authored
Feb 29, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
d94ed2a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
35 deletions
+8
-35
spec/services/projects/operations/update_service_spec.rb
spec/services/projects/operations/update_service_spec.rb
+8
-35
No files found.
spec/services/projects/operations/update_service_spec.rb
View file @
1ab1a6ee
...
...
@@ -298,55 +298,28 @@ describe Projects::Operations::UpdateService do
manual_configuration:
"0"
})
end
let
(
:prometheus_params
)
do
{
"type"
=>
"PrometheusService"
,
"title"
=>
nil
,
"active"
=>
true
,
"properties"
=>
{
"api_url"
=>
"http://example.prometheus.com"
,
"manual_configuration"
=>
"0"
},
"push_events"
=>
true
,
"issues_events"
=>
true
,
"merge_requests_events"
=>
true
,
"tag_push_events"
=>
true
,
"note_events"
=>
true
,
"category"
=>
"monitoring"
,
"default"
=>
false
,
"wiki_page_events"
=>
true
,
"pipeline_events"
=>
true
,
"confidential_issues_events"
=>
true
,
"commit_events"
=>
true
,
"job_events"
=>
true
,
"confidential_note_events"
=>
true
,
"deployment_events"
=>
false
,
"description"
=>
nil
,
"comment_on_event_enabled"
=>
true
,
"template"
=>
false
}
end
let
(
:params
)
do
{
prometheus_integration_attributes:
{
api_url:
'http://new.prometheus.com'
,
manual_configuration:
'1'
'api_url'
=>
'http://new.prometheus.com'
,
'manual_configuration'
=>
'1'
}
}
end
it
'uses Project#find_or_initialize_service to include instance defined defaults and pass them to Projects::UpdateService'
,
:aggregate_failures
do
project_update_service
=
double
(
Projects
::
UpdateService
)
prometheus_update_params
=
prometheus_params
.
merge
(
'properties'
=>
{
'api_url'
=>
'http://new.prometheus.com'
,
'manual_configuration'
=>
'1'
})
expect
(
project
)
.
to
receive
(
:find_or_initialize_service
)
.
with
(
'prometheus'
)
.
and_return
(
prometheus_service
)
expect
(
Projects
::
UpdateService
)
.
to
receive
(
:new
)
.
with
(
project
,
user
,
{
prometheus_service_attributes:
prometheus_update_params
})
.
and_return
(
project_update_service
)
expect
(
Projects
::
UpdateService
).
to
receive
(
:new
)
do
|
project_arg
,
user_arg
,
update_params_hash
|
expect
(
project_arg
).
to
eq
project
expect
(
user_arg
).
to
eq
user
expect
(
update_params_hash
[
:prometheus_service_attributes
]).
to
include
(
'properties'
=>
{
'api_url'
=>
'http://new.prometheus.com'
,
'manual_configuration'
=>
'1'
})
expect
(
update_params_hash
[
:prometheus_service_attributes
]).
not_to
include
(
*
%w(id project_id created_at updated_at)
)
end
.
and_return
(
project_update_service
)
expect
(
project_update_service
).
to
receive
(
:execute
)
subject
.
execute
...
...
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