summaryrefslogtreecommitdiff
path: root/spec/models/issue
diff options
context:
space:
mode:
authorJarka Košanová <jarka@gitlab.com>2019-01-14 11:46:39 +0100
committerJarka Košanová <jarka@gitlab.com>2019-02-14 15:28:02 +0100
commit30ab6ee416783cd9481085f021603383eeb4f317 (patch)
tree4d4f9eee50812ff132125859860077e6364ecb4e /spec/models/issue
parent66b20a66f4b25a69ff3f59da855ac2cb38c8bca9 (diff)
downloadgitlab-ce-30ab6ee416783cd9481085f021603383eeb4f317.tar.gz
Check issue milestone availability
Add project when creating milestone in specs We validate milestone is from the same project/parent group as issuable -> we need to set project in specs correctly Improve methods names and specs organization
Diffstat (limited to 'spec/models/issue')
-rw-r--r--spec/models/issue/metrics_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/issue/metrics_spec.rb b/spec/models/issue/metrics_spec.rb
index 1bf0ecb98ad..b7291eebe64 100644
--- a/spec/models/issue/metrics_spec.rb
+++ b/spec/models/issue/metrics_spec.rb
@@ -9,7 +9,7 @@ describe Issue::Metrics do
context "milestones" do
it "records the first time an issue is associated with a milestone" do
time = Time.now
- Timecop.freeze(time) { subject.update(milestone: create(:milestone)) }
+ Timecop.freeze(time) { subject.update(milestone: create(:milestone, project: project)) }
metrics = subject.metrics
expect(metrics).to be_present
@@ -18,9 +18,9 @@ describe Issue::Metrics do
it "does not record the second time an issue is associated with a milestone" do
time = Time.now
- Timecop.freeze(time) { subject.update(milestone: create(:milestone)) }
+ Timecop.freeze(time) { subject.update(milestone: create(:milestone, project: project)) }
Timecop.freeze(time + 2.hours) { subject.update(milestone: nil) }
- Timecop.freeze(time + 6.hours) { subject.update(milestone: create(:milestone)) }
+ Timecop.freeze(time + 6.hours) { subject.update(milestone: create(:milestone, project: project)) }
metrics = subject.metrics
expect(metrics).to be_present