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:
authorEtienne BaquƩ <ebaque@gitlab.com>2019-09-03 12:38:59 +0300
committerAndreas Brandl <abrandl@gitlab.com>2019-09-03 12:38:59 +0300
commita43ab8d6a430014e875deb3bff3fd8d8da256747 (patch)
tree25da7465575e53501737bb0d71709021173f7319 /spec/services/milestones
parentde4e2dcafceee485cba9ef6993062b00a4929d2f (diff)
Added relationships between Release and Milestone
Modified schema via migrations. Added one-to-one relationship between the two models. Added changelog file
Diffstat (limited to 'spec/services/milestones')
-rw-r--r--spec/services/milestones/destroy_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/milestones/destroy_service_spec.rb b/spec/services/milestones/destroy_service_spec.rb
index 3a22e4d4f92..ff1e1256166 100644
--- a/spec/services/milestones/destroy_service_spec.rb
+++ b/spec/services/milestones/destroy_service_spec.rb
@@ -65,5 +65,19 @@ describe Milestones::DestroyService do
expect { service.execute(group_milestone) }.not_to change { Event.count }
end
end
+
+ context 'when a release is tied to a milestone' do
+ it 'destroys the milestone but not the associated release' do
+ release = create(
+ :release,
+ tag: 'v1.0',
+ project: project,
+ milestone: milestone
+ )
+
+ expect { service.execute(milestone) }.not_to change { Release.count }
+ expect(release.reload).to be_persisted
+ end
+ end
end
end