Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/milestones/transfer_service_spec.rb')
-rw-r--r--spec/services/milestones/transfer_service_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/milestones/transfer_service_spec.rb b/spec/services/milestones/transfer_service_spec.rb
index 9b087b07cea..9f94d2d320b 100644
--- a/spec/services/milestones/transfer_service_spec.rb
+++ b/spec/services/milestones/transfer_service_spec.rb
@@ -40,6 +40,16 @@ describe Milestones::TransferService do
expect(new_milestone.project_milestone?).to be_truthy
end
+ context 'when milestone is from an ancestor group' do
+ let(:old_group_ancestor) { create(:group) }
+ let(:old_group) { create(:group, parent: old_group_ancestor) }
+ let(:group_milestone) { create(:milestone, group: old_group_ancestor)}
+
+ it 'recreates the missing group milestones at project level' do
+ expect { service.execute }.to change(project.milestones, :count).by(1)
+ end
+ end
+
it 'deletes milestone issue counters cache for both milestones' do
new_milestone = create(:milestone, project: project, title: group_milestone.title)