diff options
Diffstat (limited to 'spec/models/concerns/milestoneish_spec.rb')
-rw-r--r-- | spec/models/concerns/milestoneish_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index 46a876f34e9..01efe66a419 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -356,4 +356,20 @@ RSpec.describe Milestone, 'Milestoneish', factory_default: :keep do expect(milestone.human_total_time_estimate).to be_nil end end + + describe '#expires_at' do + it 'returns the date when milestone expires' do + due_date = Date.today + 1.day + milestone.due_date = due_date + + expect(milestone.expires_at).to eq("expires on #{due_date.to_fs(:medium)}") + end + + it 'returns the date when milestone expires' do + due_date = Date.today - 1.day + milestone.due_date = due_date + + expect(milestone.expires_at).to eq("expired on #{due_date.to_fs(:medium)}") + end + end end |