diff options
author | Eagllus <rvanzon@gitlab.com> | 2018-10-22 13:56:08 +0200 |
---|---|---|
committer | Eagllus <rvanzon@gitlab.com> | 2018-10-22 13:56:08 +0200 |
commit | 473138f1151905b86527c2664d822c056f57b5cd (patch) | |
tree | ad99b5da7efc6747a6f502354d284e3b12a99c4f | |
parent | c42f15c03f3e4f72aa0bd5d978cc4ee1cf2a75de (diff) | |
download | gitlab-ce-473138f1151905b86527c2664d822c056f57b5cd.tar.gz |
Update related tests based on comment
-rw-r--r-- | spec/models/milestone_spec.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index b6aad769e3b..617f0151f33 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -353,21 +353,26 @@ describe Milestone do context 'when the projects have milestones' do let(:project_1) { create(:project) } let(:project_2) { create(:project) } - let(:project_3) { create(:project) } + let(:group_1) { create(:group) } + let(:group_2) { create(:group) } before do - create(:closed_milestone, title: 'Active Group Milestone', project: project_3) create(:active_milestone, title: 'Active Group Milestone', project: project_1) - create(:active_milestone, title: 'Active Group Milestone', project: project_2) create(:closed_milestone, title: 'Closed Group Milestone', project: project_1) + create(:active_milestone, title: 'Active Group Milestone', project: project_2) create(:closed_milestone, title: 'Closed Group Milestone', project: project_2) - create(:closed_milestone, title: 'Closed Group Milestone', project: project_3) + create(:closed_milestone, title: 'Active Group Milestone', group: group_1) + create(:closed_milestone, title: 'Closed Group Milestone', group: group_1) + create(:closed_milestone, title: 'Active Group Milestone', group: group_2) + create(:closed_milestone, title: 'Closed Group Milestone', group: group_2) end it 'returns the quantity of milestones in each possible state' do - expected_count = { opened: 5, closed: 4, all: 9 } + expected_count = { opened: 5, closed: 6, all: 11 } + + count = described_class.states_count(Project.all, Group.all) - count = described_class.states_count(Project.all) + p Project.all, Group.all expect(count).to eq(expected_count) end |