@@ -22,7 +22,8 | |||||
22 | <% if User.current.allowed_to_view_all_time_entries?(@project) %> |
|
22 | <% if User.current.allowed_to_view_all_time_entries?(@project) %> | |
23 | <tr> |
|
23 | <tr> | |
24 | <th><%= l(:label_spent_time) %></th> |
|
24 | <th><%= l(:label_spent_time) %></th> | |
25 |
<td class="total-hours"><%= html_hours(l_hours(@version.spent_hours)) |
|
25 | <td class="total-hours"><%= link_to html_hours(l_hours(@version.spent_hours)), | |
|
26 | project_time_entries_path(@version.project, :set_filter => 1, :"issue.fixed_version_id" => @version.id) %></td> | |||
26 | </tr> |
|
27 | </tr> | |
27 | <% end %> |
|
28 | <% end %> | |
28 | </table> |
|
29 | </table> |
@@ -20,7 +20,7 require File.expand_path('../../test_helper', __FILE__) | |||||
20 | class VersionsControllerTest < ActionController::TestCase |
|
20 | class VersionsControllerTest < ActionController::TestCase | |
21 | fixtures :projects, :versions, :issues, :users, :roles, :members, |
|
21 | fixtures :projects, :versions, :issues, :users, :roles, :members, | |
22 | :member_roles, :enabled_modules, :issue_statuses, |
|
22 | :member_roles, :enabled_modules, :issue_statuses, | |
23 | :issue_categories |
|
23 | :issue_categories, :enumerations | |
24 |
|
24 | |||
25 | def setup |
|
25 | def setup | |
26 | User.current = nil |
|
26 | User.current = nil | |
@@ -98,6 +98,18 class VersionsControllerTest < ActionController::TestCase | |||||
98 | assert_select 'h2', :text => /1.0/ |
|
98 | assert_select 'h2', :text => /1.0/ | |
99 | end |
|
99 | end | |
100 |
|
100 | |||
|
101 | def test_show_should_link_to_spent_time_on_version | |||
|
102 | version = Version.generate! | |||
|
103 | issue = Issue.generate(:fixed_version => version) | |||
|
104 | TimeEntry.generate!(:issue => issue, :hours => 7.2) | |||
|
105 | ||||
|
106 | get :show, :id => version.id | |||
|
107 | assert_response :success | |||
|
108 | ||||
|
109 | assert_select '.total-hours', :text => '7.20 hours' | |||
|
110 | assert_select '.total-hours a[href=?]', "/projects/ecookbook/time_entries?issue.fixed_version_id=#{version.id}&set_filter=1" | |||
|
111 | end | |||
|
112 | ||||
101 | def test_show_should_display_nil_counts |
|
113 | def test_show_should_display_nil_counts | |
102 | with_settings :default_language => 'en' do |
|
114 | with_settings :default_language => 'en' do | |
103 | get :show, :id => 2, :status_by => 'category' |
|
115 | get :show, :id => 2, :status_by => 'category' |
General Comments 0
You need to be logged in to leave comments.
Login now