BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3bff8da8
Commit
3bff8da8
authored
May 04, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix service spec
parent
3d807dc8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
service.rb
app/models/service.rb
+1
-1
service_spec.rb
spec/models/service_spec.rb
+6
-5
No files found.
app/models/service.rb
View file @
3bff8da8
...
...
@@ -257,7 +257,7 @@ class Service < ActiveRecord::Base
def
update_and_propagate
(
service_params
)
return
false
unless
update_attributes
(
service_params
)
if
service_params
[
:active
]
==
1
if
service_params
[
:active
]
PropagateProjectServiceWorker
.
perform_async
(
service_params
[
:id
])
end
...
...
spec/models/service_spec.rb
View file @
3bff8da8
...
...
@@ -256,26 +256,27 @@ describe Service, models: true do
end
describe
"#update_and_propagate"
do
let
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:service
)
do
RedmineService
.
new
(
project:
project
,
active:
false
,
properties:
{
project_url:
'http://
redmine/projects/project_name_in_redmine
'
,
issues_url:
"http://redmine/
#{
project
.
id
}
/project_name_in_redmine/:id"
,
new_issue_url:
'http://
redmine/projects/project_name_in_redmine/issues/new
'
project_url:
'http://
abc
'
,
issues_url:
'http://abc'
,
new_issue_url:
'http://
abc
'
}
)
end
it
'updates the service params successfully and calls the propagation worker'
do
expect
(
PropagateProjectServiceWorker
).
to
receve
(
:perform_async
)
expect
(
PropagateProjectServiceWorker
).
to
rece
i
ve
(
:perform_async
)
expect
(
service
.
update_and_propagate
(
active:
true
)).
to
be
true
end
it
'updates the service params successfully'
do
expect
(
PropagateProjectServiceWorker
).
not_to
rece
ve
(
:perform_asyncs
)
expect
(
PropagateProjectServiceWorker
).
not_to
rece
ive
(
:perform_async
)
expect
(
service
.
update_and_propagate
(
properties:
{})).
to
be
true
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