Commit bd3ae192 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Rename MWPS in system notes and related tests

parent 01f23889
...@@ -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
......
%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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment