diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-09-23 13:34:39 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-09-23 13:34:39 +0200 |
commit | b5132118cd43a3e005f0ed159d4a1be34b9a6ce6 (patch) | |
tree | b90d0a6fdf68c32208294dee42909177612f0d7d /spec/models/global_milestone_spec.rb | |
parent | b8bfe50a5080909c7ba2b517d99d3c5f79d2a32f (diff) | |
download | gitlab-ce-b5132118cd43a3e005f0ed159d4a1be34b9a6ce6.tar.gz |
Ensure milestones passed to GlobalMilestone is an ActiveRecord::Relation
Diffstat (limited to 'spec/models/global_milestone_spec.rb')
-rw-r--r-- | spec/models/global_milestone_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/global_milestone_spec.rb b/spec/models/global_milestone_spec.rb index 92e0f7f27ce..dd033480527 100644 --- a/spec/models/global_milestone_spec.rb +++ b/spec/models/global_milestone_spec.rb @@ -50,8 +50,9 @@ describe GlobalMilestone, models: true do milestone1_project2, milestone1_project3, ] + milestones_relation = Milestone.where(id: milestones.map(&:id)) - @global_milestone = GlobalMilestone.new(milestone1_project1.title, milestones) + @global_milestone = GlobalMilestone.new(milestone1_project1.title, milestones_relation) end it 'has exactly one group milestone' do @@ -67,7 +68,7 @@ describe GlobalMilestone, models: true do let(:milestone) { create(:milestone, title: "git / test", project: project1) } it 'strips out slashes and spaces' do - global_milestone = GlobalMilestone.new(milestone.title, [milestone]) + global_milestone = GlobalMilestone.new(milestone.title, Milestone.where(id: milestone.id)) expect(global_milestone.safe_title).to eq('git-test') end |