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
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-09 15:15:37 +0300
committerDouwe Maan <douwe@selenight.nl>2016-02-09 15:15:37 +0300
commit643c61867cc99f626d58798a5365e7573f90b176 (patch)
tree022a2c2d834c9f65fe10ec712bc62d8445b8ebe4 /spec
parente0f923a1722e99fc54f01513474fe1ace414ccfd (diff)
parent308c967d0dee4b56613d4b285fbd0cf0a1c3ce69 (diff)
Merge branch 'zj/gitlab-ce-unique-milestone-title-per-project'
Diffstat (limited to 'spec')
-rw-r--r--spec/models/milestone_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
index 30a71987d86..1b1380ce4e2 100644
--- a/spec/models/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -33,6 +33,20 @@ describe Milestone, models: true do
let(:milestone) { create(:milestone) }
let(:issue) { create(:issue) }
+ describe "unique milestone title per project" do
+ it "shouldn't accept the same title in a project twice" do
+ new_milestone = Milestone.new(project: milestone.project, title: milestone.title)
+ expect(new_milestone).not_to be_valid
+ end
+
+ it "should accept the same title in another project" do
+ project = build(:project)
+ new_milestone = Milestone.new(project: project, title: milestone.title)
+
+ expect(new_milestone).to be_valid
+ end
+ end
+
describe "#percent_complete" do
it "should not count open issues" do
milestone.issues << issue