Commit e7969d6f authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Satisfy Douwe Maan

parent 4c8666e6
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased) v 8.3.0 (unreleased)
- Merge when build succeeds (Zeger-Jan van de Weg) - Merge when build succeeds (Zeger-Jan van de Weg)
- Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera)
- Fix 500 error when update group member permission - Fix 500 error when update group member permission
- Trim leading and trailing whitespace of milestone and issueable titles (Jose Corcuera) - Trim leading and trailing whitespace of milestone and issueable titles (Jose Corcuera)
......
...@@ -132,7 +132,7 @@ class SystemNoteService ...@@ -132,7 +132,7 @@ class SystemNoteService
# Called when 'merge when build succeeds' is executed # Called when 'merge when build succeeds' is executed
def self.merge_when_build_succeeds(noteable, project, author, last_commit) def self.merge_when_build_succeeds(noteable, project, author, last_commit)
body = "Enabled an automatic merge when the build for #{last_commit.to_reference} succeeds" body = "Enabled an automatic merge when the build 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
......
require 'spec_helper' require 'spec_helper'
# rubocop:disable Lint/UselessAssignment
# As rubocop doesn't see a need for both `ci_commit` and `ci_build`
feature 'Merge When Build Succeeds', feature: true, js: true do feature 'Merge When Build Succeeds', feature: true, js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -14,10 +12,10 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -14,10 +12,10 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end end
context "Active build for Merge Request" do context "Active build for Merge Request" do
before do let!(:ci_commit) { create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
ci_commit = create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) let!(:ci_build) { create(:ci_build, commit: ci_commit) }
ci_build = create(:ci_build, commit: ci_commit)
before do
login_as user login_as user
visit_merge_request(merge_request) visit_merge_request(merge_request)
end end
...@@ -49,14 +47,15 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -49,14 +47,15 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
merge_user: user, title: "MepMep", merge_when_build_succeeds: true) merge_user: user, title: "MepMep", merge_when_build_succeeds: true)
end end
let!(:ci_commit) { create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, commit: ci_commit) }
before do before do
merge_request.source_project.team << [user, :master] merge_request.source_project.team << [user, :master]
merge_request.source_branch = "feature" merge_request.source_branch = "feature"
merge_request.target_branch = "master" merge_request.target_branch = "master"
merge_request.save! merge_request.save!
ci_commit = create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch)
ci_build = create(:ci_build, commit: ci_commit)
login_as user login_as user
visit_merge_request(merge_request) visit_merge_request(merge_request)
...@@ -90,4 +89,3 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -90,4 +89,3 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request) visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
end end
end end
# rubocop:enable Lint/UselessAssignment
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