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
25b3b2e5
Commit
25b3b2e5
authored
Feb 15, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to resolve all todos for pipeline
parent
fc133129
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
add_todo_when_build_fails_service.rb
...vices/merge_requests/add_todo_when_build_fails_service.rb
+6
-0
add_todo_when_build_fails_service_spec.rb
.../merge_requests/add_todo_when_build_fails_service_spec.rb
+24
-1
No files found.
app/services/merge_requests/add_todo_when_build_fails_service.rb
View file @
25b3b2e5
...
...
@@ -18,5 +18,11 @@ module MergeRequests
todo_service
.
merge_request_build_retried
(
merge_request
)
end
end
def
close_all
(
pipeline
)
pipeline_merge_requests
(
pipeline
)
do
|
merge_request
|
todo_service
.
merge_request_build_retried
(
merge_request
)
end
end
end
end
spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb
View file @
25b3b2e5
...
...
@@ -17,7 +17,7 @@ describe MergeRequests::AddTodoWhenBuildFailsService do
described_class
.
new
(
project
,
user
,
commit_message:
'Awesome message'
)
end
let
(
:todo_service
)
{
TodoService
.
new
}
let
(
:todo_service
)
{
spy
(
'todo service'
)
}
let
(
:merge_request
)
do
create
(
:merge_request
,
merge_user:
user
,
...
...
@@ -107,4 +107,27 @@ describe MergeRequests::AddTodoWhenBuildFailsService do
end
end
end
describe
'#close_all'
do
context
'when using pipeline that belongs to merge request'
do
it
'resolves todos about failed builds for pipeline'
do
service
.
close_all
(
pipeline
)
expect
(
todo_service
)
.
to
have_received
(
:merge_request_build_retried
)
.
with
(
merge_request
)
end
end
context
'when pipeline is not related to merge request'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
it
'does not resolve any todos about failed builds'
do
service
.
close_all
(
pipeline
)
expect
(
todo_service
)
.
not_to
have_received
(
:merge_request_build_retried
)
end
end
end
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