Commit b2d5869e authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch '23602-show-milestone-id-in-a-consistent-way' into 'master'

Show milestone ID in a consistent way

Closes #23602

See merge request !8820
parents 4c4810b3 3daf142f
...@@ -97,7 +97,7 @@ module MilestonesHelper ...@@ -97,7 +97,7 @@ module MilestonesHelper
def milestone_date_range(milestone) def milestone_date_range(milestone)
if milestone.start_date && milestone.due_date if milestone.start_date && milestone.due_date
"#{milestone.start_date.to_s(:medium)} - #{milestone.due_date.to_s(:medium)}" "#{milestone.start_date.to_s(:medium)}#{milestone.due_date.to_s(:medium)}"
elsif milestone.due_date elsif milestone.due_date
if milestone.due_date.past? if milestone.due_date.past?
"expired on #{milestone.due_date.to_s(:medium)}" "expired on #{milestone.due_date.to_s(:medium)}"
......
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
Open Open
.header-text-content .header-text-content
%span.identifier %span.identifier
Milestone ##{@milestone.iid} %strong
Milestone %#{@milestone.iid}
- if @milestone.due_date || @milestone.start_date - if @milestone.due_date || @milestone.start_date
%span.creator
·
= milestone_date_range(@milestone) = milestone_date_range(@milestone)
.milestone-buttons .milestone-buttons
- if can?(current_user, :admin_milestone, @project) - if can?(current_user, :admin_milestone, @project)
......
...@@ -24,7 +24,7 @@ feature 'Milestone', feature: true do ...@@ -24,7 +24,7 @@ feature 'Milestone', feature: true do
find('input[name="commit"]').click find('input[name="commit"]').click
expect(find('.alert-success')).to have_content('Assign some issues to this milestone.') expect(find('.alert-success')).to have_content('Assign some issues to this milestone.')
expect(page).to have_content('Nov 16, 2016 - Dec 16, 2016') expect(page).to have_content('Nov 16, 2016Dec 16, 2016')
end end
end end
......
...@@ -17,7 +17,7 @@ describe MilestonesHelper do ...@@ -17,7 +17,7 @@ describe MilestonesHelper do
it { expect(result_for(due_date: yesterday)).to eq("expired on #{yesterday_formatted}") } it { expect(result_for(due_date: yesterday)).to eq("expired on #{yesterday_formatted}") }
it { expect(result_for(start_date: tomorrow)).to eq("starts on #{tomorrow_formatted}") } it { expect(result_for(start_date: tomorrow)).to eq("starts on #{tomorrow_formatted}") }
it { expect(result_for(start_date: yesterday)).to eq("started on #{yesterday_formatted}") } it { expect(result_for(start_date: yesterday)).to eq("started on #{yesterday_formatted}") }
it { expect(result_for(start_date: yesterday, due_date: tomorrow)).to eq("#{yesterday_formatted} - #{tomorrow_formatted}") } it { expect(result_for(start_date: yesterday, due_date: tomorrow)).to eq("#{yesterday_formatted}#{tomorrow_formatted}") }
end end
describe '#milestone_counts' do describe '#milestone_counts' do
......
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