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