From 561693ad173b22dab54a0fdd5446f7637095272a Mon Sep 17 00:00:00 2001 From: George Andrinopoulos Date: Mon, 6 Nov 2017 20:18:20 +0200 Subject: Move total time spend calculation to milestoneish --- spec/models/concerns/milestoneish_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/models/concerns/milestoneish_spec.rb') diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index 66353935427..c0a51e170fc 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -186,4 +186,15 @@ describe Milestone, 'Milestoneish' do expect(milestone.elapsed_days).to eq(2) end end + + describe '#total_issue_time_spent' do + it 'calculates total issue time spent' do + closed_issue_1.spend_time(duration: 300, user: author) + closed_issue_1.save! + closed_issue_2.spend_time(duration: 600, user: assignee) + closed_issue_2.save! + + expect(milestone.total_issue_time_spent).to eq(900) + end + end end -- cgit v1.2.1