Changed validation error message on wrong milestone dates

parent 6675bab5
...@@ -256,7 +256,7 @@ class Milestone < ActiveRecord::Base ...@@ -256,7 +256,7 @@ class Milestone < ActiveRecord::Base
def start_date_should_be_less_than_due_date def start_date_should_be_less_than_due_date
if due_date <= start_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
end end
......
---
title: Changed validation error message on wrong milestone dates
merge_request:
author: Xurxo Méndez Pérez
type: fixed
...@@ -11,7 +11,7 @@ describe Milestone do ...@@ -11,7 +11,7 @@ describe Milestone do
milestone = build(:milestone, start_date: Date.tomorrow, due_date: Date.yesterday) milestone = build(:milestone, start_date: Date.tomorrow, due_date: Date.yesterday)
expect(milestone).not_to be_valid 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 end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment