diff options
author | Xurxo Méndez Pérez <sonxurxo@smartgalapps.com> | 2017-11-18 19:22:11 +0100 |
---|---|---|
committer | Xurxo Méndez Pérez <sonxurxo@smartgalapps.com> | 2017-11-18 19:30:32 +0100 |
commit | b3a5abe4aedd1d4f4a22e01f1f5a5b6e146d6eec (patch) | |
tree | 73bf8f5b39fef018695bbdd6f7640ce45a572fd2 | |
parent | 6675bab59944bf075579bfb84cb1dd26cada39e9 (diff) | |
download | gitlab-ce-b3a5abe4aedd1d4f4a22e01f1f5a5b6e146d6eec.tar.gz |
Changed validation error message on wrong milestone dates
-rw-r--r-- | app/models/milestone.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/38393-Milestone-duration-error-message-is-not-accurate-enough.yml | 5 | ||||
-rw-r--r-- | spec/models/milestone_spec.rb | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 47e6b785c39..e01e52131f0 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -256,7 +256,7 @@ class Milestone < ActiveRecord::Base def start_date_should_be_less_than_due_date if due_date <= start_date - errors.add(:start_date, "Can't be greater than due date") + errors.add(:due_date, "must be greater than start date") end end diff --git a/changelogs/unreleased/38393-Milestone-duration-error-message-is-not-accurate-enough.yml b/changelogs/unreleased/38393-Milestone-duration-error-message-is-not-accurate-enough.yml new file mode 100644 index 00000000000..c73cf8bf60b --- /dev/null +++ b/changelogs/unreleased/38393-Milestone-duration-error-message-is-not-accurate-enough.yml @@ -0,0 +1,5 @@ +--- +title: Changed validation error message on wrong milestone dates +merge_request: +author: Xurxo Méndez Pérez +type: fixed diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 13e37fffa4e..47f4a792e5c 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -11,7 +11,7 @@ describe Milestone do milestone = build(:milestone, start_date: Date.tomorrow, due_date: Date.yesterday) expect(milestone).not_to be_valid - expect(milestone.errors[:start_date]).to include("Can't be greater than due date") + expect(milestone.errors[:due_date]).to include("must be greater than start date") end end end |