Commit 41e9a784 authored by Sean Carroll's avatar Sean Carroll

Applied reviewer suggestion

parent 8fca2bea
......@@ -81,7 +81,7 @@ class Release < ApplicationRecord
evidence&.summary || {}
end
def milestone_list
def milestone_titles
self.milestones.map {|m| m.title }.sort.join(", ")
end
......
......@@ -4,7 +4,7 @@ module EE
module AuditEvents
class ReleaseAssociateMilestoneAuditEventService < ReleaseAuditEventService
def message
milestones = @release.milestone_list
milestones = @release.milestone_titles
milestones = "[none]" if milestones.blank?
"Milestones associated with release changed to #{milestones}"
......
......@@ -8,7 +8,7 @@ module EE
milestone_count = release.milestones.count
if milestone_count > 0
"#{simple_message} with #{'Milestone'.pluralize(milestone_count)} #{release.milestone_list}"
"#{simple_message} with #{'Milestone'.pluralize(milestone_count)} #{release.milestone_titles}"
else
simple_message
end
......
......@@ -182,9 +182,9 @@ RSpec.describe Release do
end
end
describe '#milestone_list' do
describe '#milestone_titles' do
let(:release) { create(:release, :with_milestones) }
it { expect(release.milestone_list).to eq(release.milestones.map {|m| m.title }.sort.join(", "))}
it { expect(release.milestone_titles).to eq(release.milestones.map {|m| m.title }.sort.join(", "))}
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