[#2271] Show overhead time on the issue details page.
This commit is contained in:
@@ -6,8 +6,13 @@ class OverheadIssueHook < Redmine::Hook::ViewListener
|
||||
:class => 'billable-hours')
|
||||
billable_spent = content_tag(:td, l_hours(context[:issue].billable_time_spent))
|
||||
|
||||
overhead_label = content_tag(:td,
|
||||
content_tag(:strong, l(:overhead_overhead_time)+":"),
|
||||
:class => 'overhead-hours')
|
||||
overhead_spent = content_tag(:td, l_hours(context[:issue].overhead_time_spent))
|
||||
|
||||
return content_tag(:tr,
|
||||
billable_label + billable_spent,
|
||||
billable_label + billable_spent + overhead_label + overhead_spent,
|
||||
:class => 'overhead-plugin')
|
||||
else
|
||||
return ''
|
||||
|
||||
@@ -32,7 +32,7 @@ describe OverheadIssueHook, "#view_issues_show_details_bottom with the budget di
|
||||
stub_view_to_use_controller_instance
|
||||
@project = mock_model(Project)
|
||||
@project.should_receive(:module_enabled?).at_least(:once).with('budget_module').and_return(true)
|
||||
@issue = mock_model(Issue, :project => @project, :deliverable => nil, :billable_time_spent => nil)
|
||||
@issue = mock_model(Issue, :project => @project, :deliverable => nil, :billable_time_spent => nil, :overhead_time_spent => nil)
|
||||
|
||||
@context = {
|
||||
:project => @project,
|
||||
@@ -52,4 +52,13 @@ describe OverheadIssueHook, "#view_issues_show_details_bottom with the budget di
|
||||
@issue.should_receive(:billable_time_spent).and_return(2.0)
|
||||
call_hook(:view_issues_show_details_bottom, @context).should have_tag('td','2.00 hours')
|
||||
end
|
||||
|
||||
it 'should display a label for the overhead time' do
|
||||
call_hook(:view_issues_show_details_bottom, @context).should have_tag('td.overhead-hours','Overhead time:')
|
||||
end
|
||||
|
||||
it 'should display the number of overhead hours' do
|
||||
@issue.should_receive(:overhead_time_spent).and_return(12.0)
|
||||
call_hook(:view_issues_show_details_bottom, @context).should have_tag('td','12.00 hours')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user