Skip to content
Snippets Groups Projects
Commit 650dff95 authored by Eugenia Grieff's avatar Eugenia Grieff :two:
Browse files

Destroy synced linked work items even when the FF is disabled

When removing a related epic that has a synced work item, also
destroy the RelatedWorkItemLinks record
parent ea52cf03
No related branches found
No related tags found
1 merge request!148157Destroy synced linked work items even when the FF is disabled
......@@ -71,9 +71,7 @@ def epic_is_link_target?
end
def sync_to_work_item!
return unless epic.group.epic_synced_with_work_item_enabled?
return unless epic.work_item
return unless source.issue_id && target.issue_id
item_ids = epic_is_link_source? ? [target.issue_id] : [source.issue_id]
......
......@@ -37,9 +37,9 @@
stub_feature_flags(epic_creation_with_synced_work_item: false)
end
it 'removes the epic but not the work item relation' do
it 'removes the epic and the work item relation' do
expect { subject }.to change { issuable_link.class.count }.by(-1)
.and not_change { WorkItems::RelatedWorkItemLink.count }
.and change { WorkItems::RelatedWorkItemLink.count }.by(-1)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment