Commit e2a9d2e8 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '10270-milestones-should-not-be-set-on-epics-issue-promotion-ce' into 'master'

CE port for milestones should not be set on epics issue promotion

See merge request gitlab-org/gitlab-ce!30633
parents 0b859d2f 4b7cf4a5
......@@ -427,4 +427,11 @@ module Issuable
def wipless_title_changed(old_title)
old_title != title
end
##
# Overridden on EE module
#
def supports_milestone?
respond_to?(:milestone_id)
end
end
......@@ -17,6 +17,8 @@ module Issuable
private
def cloneable_milestone
return unless new_entity.supports_milestone?
title = original_entity.milestone&.title
return unless title
......
......@@ -774,4 +774,25 @@ describe Issuable do
end
end
end
describe '#supports_milestone?' do
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
context "for issues" do
let(:issue) { build(:issue, project: project) }
it 'returns true' do
expect(issue.supports_milestone?).to be_truthy
end
end
context "for merge requests" do
let(:merge_request) { build(:merge_request, target_project: project, source_project: project) }
it 'returns true' do
expect(merge_request.supports_milestone?).to be_truthy
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