From 713da39aa63e5a9027af0c6086daa9dba898e537 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 3 Jul 2024 09:40:48 +0000 Subject: [PATCH] Merged r22902 from trunk to 5.0-stable (#40924). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22904 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/issues/destroy.html.erb | 2 +- app/views/timelog/bulk_edit.html.erb | 2 +- test/functional/issues_controller_test.rb | 16 +++++++++------- test/functional/timelog_controller_test.rb | 6 ++++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/views/issues/destroy.html.erb b/app/views/issues/destroy.html.erb index 61b841a62..e4f0e66fb 100644 --- a/app/views/issues/destroy.html.erb +++ b/app/views/issues/destroy.html.erb @@ -3,7 +3,7 @@ <%= form_tag({}, :method => :delete) do %> <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id, :id => nil)}.join("\n").html_safe %>
-

<%= l(:text_destroy_time_entries_question, :hours => number_with_precision(@hours, :precision => 2)) %>

+

<%= l(:text_destroy_time_entries_question, :hours => format_hours(@hours)) %>


<% unless Setting.timelog_required_fields.include?('issue_id') %> diff --git a/app/views/timelog/bulk_edit.html.erb b/app/views/timelog/bulk_edit.html.erb index 3571b4016..a4cb0c8af 100644 --- a/app/views/timelog/bulk_edit.html.erb +++ b/app/views/timelog/bulk_edit.html.erb @@ -21,7 +21,7 @@ <%= content_tag 'li', link_to( - "#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)} (#{entry.user})", + "#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => format_hours(entry.hours))} (#{entry.user})", edit_time_entry_path(entry) ) %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 87a584660..b2aa4df34 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -8125,14 +8125,16 @@ class IssuesControllerTest < Redmine::ControllerTest leaf = Issue.generate! TimeEntry.generate!(:issue => leaf) @request.session[:user_id] = 2 - delete( - :destroy, - :params => { - :ids => [parent.id, leaf.id] - } - ) + with_settings :timespan_format => 'minutes' do + delete( + :destroy, + :params => { + :ids => [parent.id, leaf.id] + } + ) + end assert_response :success - assert_select 'p', :text => /3\.00 hours were reported/ + assert_select 'p', :text => /3:00 hours were reported/ end def test_destroy_issues_and_destroy_time_entries diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 2945db6a0..7b2eb3ade 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -714,12 +714,14 @@ class TimelogControllerTest < Redmine::ControllerTest def test_get_bulk_edit @request.session[:user_id] = 2 - get :bulk_edit, :params => {:ids => [1, 2]} + with_settings :timespan_format => 'minutes' do + get :bulk_edit, :params => {:ids => [1, 2]} + end assert_response :success assert_select 'ul#bulk-selection' do assert_select 'li', 2 - assert_select 'li a', :text => '03/23/2007 - eCookbook: 4.25 hours (John Smith)' + assert_select 'li a', :text => '03/23/2007 - eCookbook: 4:15 hours (John Smith)' end assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do -- 2.39.5