Commit fd8bd5ed authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch '215549-skip-copying-weight-events-when-promoting-issue' into 'master'

Do not try to copy weight events when promoting an issue

See merge request gitlab-org/gitlab!43891
parents dda21b59 3cff6cb3
......@@ -56,7 +56,7 @@ module Issuable
end
def copy_resource_weight_events
return unless original_entity.respond_to?(:resource_weight_events)
return unless both_respond_to?(:resource_weight_events)
copy_events(ResourceWeightEvent.table_name, original_entity.resource_weight_events) do |event|
event.attributes
......
---
title: Do not try to copy issue weight events when promoting an issue to epic
merge_request: 43891
author:
type: fixed
......@@ -39,6 +39,16 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
subject.execute
end
end
context 'when issue has weight events' do
it 'ignores copying weight events' do
create_list(:resource_weight_event, 2, issue: original_issue)
expect(subject).not_to receive(:copy_events).with(ResourceWeightEvent.table_name, any_args)
expect { subject.execute }.not_to change { ResourceWeightEvent.count }
end
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