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
bd3ae192
Commit
bd3ae192
authored
Nov 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MWPS in system notes and related tests
parent
01f23889
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
app/views/projects/merge_requests/widget/open/_merge_when_build_succeeds.html.haml
...requests/widget/open/_merge_when_build_succeeds.html.haml
+1
-1
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+2
-2
spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb
...rge_requests/merge_when_pipeline_succeeds_service_spec.rb
+1
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+3
-3
No files found.
app/services/system_note_service.rb
View file @
bd3ae192
...
...
@@ -135,7 +135,7 @@ module SystemNoteService
# Called when 'merge when build succeeds' is executed
def
merge_when_build_succeeds
(
noteable
,
project
,
author
,
last_commit
)
body
=
"Enabled an automatic merge when the
build
for
#{
last_commit
.
to_reference
(
project
)
}
succeeds"
body
=
"Enabled an automatic merge when the
pipeline
for
#{
last_commit
.
to_reference
(
project
)
}
succeeds"
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
end
...
...
app/views/projects/merge_requests/widget/open/_merge_when_build_succeeds.html.haml
View file @
bd3ae192
%h4
Set by
#{
link_to_member
(
@project
,
@merge_request
.
merge_user
,
avatar:
true
)
}
to be merged automatically when the
build
succeeds.
to be merged automatically when the
pipeline
succeeds.
%div
%p
=
succeed
'.'
do
...
...
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
bd3ae192
...
...
@@ -40,11 +40,11 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
it
'activates Merge When Build Succeeds feature'
do
expect
(
page
).
to
have_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the
build
succeeds."
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the
pipeline
succeeds."
expect
(
page
).
to
have_content
"The source branch will not be removed."
visit_merge_request
(
merge_request
)
# Needed to refresh the page
expect
(
page
).
to
have_content
/Enabled an automatic merge when the
build
for [0-9a-f]{8} succeeds/i
expect
(
page
).
to
have_content
/Enabled an automatic merge when the
pipeline
for [0-9a-f]{8} succeeds/i
end
end
end
...
...
spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb
View file @
bd3ae192
...
...
@@ -40,7 +40,7 @@ describe MergeRequests::MergeWhenPipelineSucceedsService do
it
'creates a system note'
do
note
=
merge_request
.
notes
.
last
expect
(
note
.
note
).
to
match
/Enabled an automatic merge when the
build
for (\w+\/\w+@)?[0-9a-z]{8}/
expect
(
note
.
note
).
to
match
/Enabled an automatic merge when the
pipeline
for (\w+\/\w+@)?[0-9a-z]{8}/
end
end
...
...
spec/services/system_note_service_spec.rb
View file @
bd3ae192
...
...
@@ -225,8 +225,8 @@ describe SystemNoteService, services: true do
it_behaves_like
'a system note'
it
"posts the
Merge When Build Succeeds
system note"
do
expect
(
subject
.
note
).
to
match
/Enabled an automatic merge when the
build
for (\w+\/\w+@)?[0-9a-f]{40} succeeds/
it
"posts the
'merge when pipeline succeeds'
system note"
do
expect
(
subject
.
note
).
to
match
/Enabled an automatic merge when the
pipeline
for (\w+\/\w+@)?[0-9a-f]{40} succeeds/
end
end
...
...
@@ -239,7 +239,7 @@ describe SystemNoteService, services: true do
it_behaves_like
'a system note'
it
"posts the
Merge When Build Succeeds
system note"
do
it
"posts the
'merge when pipeline succeeds'
system note"
do
expect
(
subject
.
note
).
to
eq
"Canceled the automatic merge"
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