Bläddra i källkod

Change the default value for "Time span format" from "decimal" to "minutes" (#36391).


git-svn-id: http://svn.redmine.org/redmine/trunk@21355 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/5.0.0
Go MAEDA 2 år sedan
förälder
incheckning
f670f0e572

+ 1
- 1
config/settings.yml Visa fil

@@ -170,7 +170,7 @@ date_format:
time_format:
default: ''
timespan_format:
default: 'decimal'
default: 'minutes'
user_format:
default: :firstname_lastname
format: symbol

+ 19
- 19
test/functional/issues_controller_test.rb Visa fil

@@ -1322,7 +1322,7 @@ class IssuesControllerTest < Redmine::ControllerTest
}
)
assert_response :success
assert_equal ['4.00', '3.00', '0.00'], columns_values_in_list('spent_hours')[0..2]
assert_equal ['4:00', '3:00', '0:00'], columns_values_in_list('spent_hours').first(3)
Project.find(3).disable_module!(:time_tracking)
get(
:index,
@@ -1332,7 +1332,7 @@ class IssuesControllerTest < Redmine::ControllerTest
}
)
assert_response :success
assert_equal ['3.00', '0.00', '0.00'], columns_values_in_list('spent_hours')[0..2]
assert_equal ['3:00', '0:00', '0:00'], columns_values_in_list('spent_hours').first(3)
end

def test_index_sort_by_total_spent_hours
@@ -1555,7 +1555,7 @@ class IssuesControllerTest < Redmine::ControllerTest
:c => %w(subject spent_hours)
}
)
assert_select 'table.issues tr#issue-3 td.spent_hours', :text => '1.00'
assert_select 'table.issues tr#issue-3 td.spent_hours', :text => '1:00'
end

def test_index_with_total_spent_hours_column
@@ -1567,7 +1567,7 @@ class IssuesControllerTest < Redmine::ControllerTest
:c => %w(subject total_spent_hours)
}
)
assert_select 'table.issues tr#issue-3 td.total_spent_hours', :text => '1.00'
assert_select 'table.issues tr#issue-3 td.total_spent_hours', :text => '1:00'
end

def test_index_with_total_estimated_hours_column
@@ -1874,21 +1874,21 @@ class IssuesControllerTest < Redmine::ControllerTest

def test_index_with_estimated_hours_total
Issue.delete_all
Issue.generate!(:estimated_hours => 5.5)
Issue.generate!(:estimated_hours => 1.1)
Issue.generate!(:estimated_hours => '5:30')
Issue.generate!(:estimated_hours => '1:06')
get(:index, :params => {:t => %w(estimated_hours)})
assert_response :success
assert_select '.query-totals'
assert_select '.total-for-estimated-hours span.value', :text => '6.60'
assert_select '.total-for-estimated-hours span.value', :text => '6:36'
assert_select 'input[type=checkbox][name=?][value=estimated_hours][checked=checked]', 't[]'
end

def test_index_with_grouped_query_and_estimated_hours_total
Issue.delete_all
Issue.generate!(:estimated_hours => 5.5, :category_id => 1)
Issue.generate!(:estimated_hours => 2.3, :category_id => 1)
Issue.generate!(:estimated_hours => 1.1, :category_id => 2)
Issue.generate!(:estimated_hours => 4.6)
Issue.generate!(:estimated_hours => '5:30', :category_id => 1)
Issue.generate!(:estimated_hours => '2:18', :category_id => 1)
Issue.generate!(:estimated_hours => '1:06', :category_id => 2)
Issue.generate!(:estimated_hours => '4:36')
get(
:index,
:params => {
@@ -1898,15 +1898,15 @@ class IssuesControllerTest < Redmine::ControllerTest
)
assert_response :success
assert_select '.query-totals'
assert_select '.query-totals .total-for-estimated-hours span.value', :text => '13.50'
assert_select '.query-totals .total-for-estimated-hours span.value', :text => '13:30'
assert_select 'tr.group', :text => /Printing/ do
assert_select '.total-for-estimated-hours span.value', :text => '7.80'
assert_select '.total-for-estimated-hours span.value', :text => '7:48'
end
assert_select 'tr.group', :text => /Recipes/ do
assert_select '.total-for-estimated-hours span.value', :text => '1.10'
assert_select '.total-for-estimated-hours span.value', :text => '1:06'
end
assert_select 'tr.group', :text => /blank/ do
assert_select '.total-for-estimated-hours span.value', :text => '4.60'
assert_select '.total-for-estimated-hours span.value', :text => '4:36'
end
end

@@ -1927,13 +1927,13 @@ class IssuesControllerTest < Redmine::ControllerTest

get :index, :params => {:t => ["spent_hours"]}
assert_response :success
assert_select ".total-for-spent-hours span.value", :text => '7.00'
assert_select ".total-for-spent-hours span.value", :text => '7:00'

Project.find(3).disable_module!(:time_tracking)

get :index, :params => {:t => ["spent_hours"]}
assert_response :success
assert_select ".total-for-spent-hours span.value", :text => '3.00'
assert_select ".total-for-spent-hours span.value", :text => '3:00'
end

def test_index_totals_should_default_to_settings
@@ -5652,7 +5652,7 @@ class IssuesControllerTest < Redmine::ControllerTest
:priority_id => 7
},
:time_entry => {
:hours => '2.5',
:hours => '2:30',
:comments => 'test_get_edit_with_params',
:activity_id => 10
}
@@ -5668,7 +5668,7 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'option[value="7"][selected=selected]', :text => 'Urgent'
end

assert_select 'input[name=?][value="2.50"]', 'time_entry[hours]'
assert_select 'input[name=?][value="2:30"]', 'time_entry[hours]'
assert_select 'select[name=?]', 'time_entry[activity_id]' do
assert_select 'option[value="10"][selected=selected]', :text => 'Development'
end

+ 2
- 2
test/functional/issues_controller_transaction_test.rb Visa fil

@@ -341,7 +341,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:subject => ''
},
:time_entry => {
:hours => '2.5',
:hours => '2:30',
:comments => 'should not be added',
:activity_id => TimeEntryActivity.first.id
}
@@ -350,7 +350,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
assert_response :success
end

assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2.50'
assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2:30'
assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'should not be added'
assert_select 'select[name=?]', 'time_entry[activity_id]' do
assert_select 'option[value=?][selected=selected]', TimeEntryActivity.first.id.to_s

+ 2
- 2
test/functional/my_controller_test.rb Visa fil

@@ -60,10 +60,10 @@ class MyControllerTest < Redmine::ControllerTest
assert_response :success
assert_select "tr#time-entry-#{with_issue.id}" do
assert_select 'td.subject a[href="/issues/1"]'
assert_select 'td.hours', :text => '2.50'
assert_select 'td.hours', :text => '2:30'
end
assert_select "tr#time-entry-#{without_issue.id}" do
assert_select 'td.hours', :text => '3.50'
assert_select 'td.hours', :text => '3:30'
end
end


+ 2
- 2
test/functional/projects_controller_test.rb Visa fil

@@ -796,8 +796,8 @@ class ProjectsControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get(:show, :params => {:id => 'ecookbook'})
assert_select 'div.spent_time.box>ul' do
assert_select '>li:nth-child(1)', :text => 'Estimated time: 203.50 hours'
assert_select '>li:nth-child(2)', :text => 'Spent time: 162.90 hours'
assert_select '>li:nth-child(1)', :text => 'Estimated time: 203:30 hours'
assert_select '>li:nth-child(2)', :text => 'Spent time: 162:54 hours'
end
end


+ 8
- 8
test/functional/timelog_controller_test.rb Visa fil

@@ -929,7 +929,7 @@ class TimelogControllerTest < Redmine::ControllerTest
get :index
assert_response :success

assert_select '.total-for-hours', :text => 'Hours: 162.90'
assert_select '.total-for-hours', :text => 'Hours: 162:54'
assert_select 'form#query_form[action=?]', '/time_entries'

assert_equal ['Project', 'Date', 'User', 'Activity', 'Issue', 'Comment', 'Hours'], columns_in_list
@@ -1008,7 +1008,7 @@ class TimelogControllerTest < Redmine::ControllerTest
projects = css_select('table.time-entries tbody td.project').map(&:text).uniq.sort
assert_equal ["eCookbook", "eCookbook Subproject 1"], projects

assert_select '.total-for-hours', :text => 'Hours: 162.90'
assert_select '.total-for-hours', :text => 'Hours: 162:54'
assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries'

# 'Log time' shoudl link to log time on the filtered issue
@@ -1046,7 +1046,7 @@ class TimelogControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2

get :index, :params => {:project_id => 'ecookbook', :issue_id => issue.id.to_s, :set_filter => 1}
assert_select '.total-for-hours', :text => 'Hours: 7.00'
assert_select '.total-for-hours', :text => 'Hours: 7:00'

# 'Log time' shoudl link to log time on the filtered issue
assert_select 'a[href=?]', "/issues/#{issue.id}/time_entries/new"
@@ -1060,7 +1060,7 @@ class TimelogControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2

get :index, :params => {:project_id => 'ecookbook', :"issue.fixed_version_id" => version.id.to_s, :set_filter => 1}
assert_select '.total-for-hours', :text => 'Hours: 5.00'
assert_select '.total-for-hours', :text => 'Hours: 5:00'
end

def test_index_at_project_level_with_multiple_issue_fixed_version_ids
@@ -1084,7 +1084,7 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_response :success

assert_select 'tr.time-entry', 2
assert_select '.total-for-hours', :text => 'Hours: 5.00'
assert_select '.total-for-hours', :text => 'Hours: 5:00'
end

def test_index_at_project_level_with_date_range
@@ -1100,7 +1100,7 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_response :success

assert_select 'tr.time-entry', 3
assert_select '.total-for-hours', :text => 'Hours: 12.90'
assert_select '.total-for-hours', :text => 'Hours: 12:54'
assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries'
end

@@ -1116,7 +1116,7 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_response :success

assert_select 'tr.time-entry', 3
assert_select '.total-for-hours', :text => 'Hours: 12.90'
assert_select '.total-for-hours', :text => 'Hours: 12:54'
assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries'
end

@@ -1528,7 +1528,7 @@ class TimelogControllerTest < Redmine::ControllerTest
get :index, :params => {:project_id => 1, :format => 'atom'}
assert_response :success
assert_equal 'application/atom+xml', @response.media_type
assert_select 'entry > title', :text => /7\.65 hours/
assert_select 'entry > title', :text => /7:39 hours/
end

def test_index_at_project_level_should_include_csv_export_dialog

+ 12
- 12
test/functional/timelog_report_test.rb Visa fil

@@ -71,33 +71,33 @@ class TimelogReportTest < Redmine::ControllerTest
def test_report_all_projects_one_criteria
get :report, :params => {:columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_select 'tr.total td:last', :text => '8.65'
assert_select 'tr.total td:last', :text => '8:39'
assert_select 'tr td.name a[href=?]', '/projects/ecookbook', :text => 'eCookbook'
end

def test_report_all_time
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue']}
assert_response :success
assert_select 'tr.total td:last', :text => '162.90'
assert_select 'tr.total td:last', :text => '162:54'
end

def test_report_all_time_by_day
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue'], :columns => 'day'}
assert_response :success
assert_select 'tr.total td:last', :text => '162.90'
assert_select 'tr.total td:last', :text => '162:54'
assert_select 'th', :text => '2007-03-12'
end

def test_report_one_criteria
get :report, :params => {:project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_select 'tr.total td:last', :text => '8.65'
assert_select 'tr.total td:last', :text => '8:39'
end

def test_report_two_criteria
get :report, :params => {:project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]}
assert_response :success
assert_select 'tr.total td:last', :text => '162.90'
assert_select 'tr.total td:last', :text => '162:54'
end

def test_report_should_show_locked_users
@@ -151,7 +151,7 @@ class TimelogReportTest < Redmine::ControllerTest
def test_report_one_day
get :report, :params => {:project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]}
assert_response :success
assert_select 'tr.total td:last', :text => '4.25'
assert_select 'tr.total td:last', :text => '4:15'
end

def test_report_by_week_should_use_commercial_year
@@ -173,10 +173,10 @@ class TimelogReportTest < Redmine::ControllerTest
end
assert_select '#time-report tbody tr' do
assert_select 'td:nth-child(1)', :text => 'eCookbook'
assert_select 'td:nth-child(2)', :text => '2.00'
assert_select 'td:nth-child(3)', :text => '12.00'
assert_select 'td:nth-child(4)', :text => '16.00'
assert_select 'td:nth-child(5)', :text => '30.00' # Total
assert_select 'td:nth-child(2)', :text => '2:00'
assert_select 'td:nth-child(3)', :text => '12:00'
assert_select 'td:nth-child(4)', :text => '16:00'
assert_select 'td:nth-child(5)', :text => '30:00' # Total
end
end

@@ -195,7 +195,7 @@ class TimelogReportTest < Redmine::ControllerTest
get :report, :params => {:criteria => ['cf_1', 'cf_3', 'cf_7']}
assert_response :success

assert_select 'tr.total td:last', :text => '162.90'
assert_select 'tr.total td:last', :text => '162:54'

# Custom fields columns
assert_select 'th', :text => 'Database'
@@ -205,7 +205,7 @@ class TimelogReportTest < Redmine::ControllerTest
# Custom field row
assert_select 'tr' do
assert_select 'td', :text => 'MySQL'
assert_select 'td.hours', :text => '1.00'
assert_select 'td.hours', :text => '1:00'
end
end


+ 2
- 2
test/functional/versions_controller_test.rb Visa fil

@@ -162,7 +162,7 @@ class VersionsControllerTest < Redmine::ControllerTest
assert_select 'a', :text => '1 open'
end

assert_select '.time-tracking td.total-hours a:first-child', :text => '2.00 hours'
assert_select '.time-tracking td.total-hours a:first-child', :text => '2:00 hours'
end

def test_show_should_link_to_spent_time_on_version
@@ -173,7 +173,7 @@ class VersionsControllerTest < Redmine::ControllerTest
get :show, :params => {:id => version.id}
assert_response :success

assert_select '.total-hours', :text => '7.20 hours'
assert_select '.total-hours', :text => '7:12 hours'
assert_select '.total-hours a[href=?]', "/projects/ecookbook/time_entries?issue.fixed_version_id=#{version.id}&set_filter=1"
end


+ 2
- 2
test/helpers/issues_helper_test.rb Visa fil

@@ -204,8 +204,8 @@ class IssuesHelperTest < Redmine::HelperTest
test 'show_detail should show old and new values with a estimated hours attribute' do
detail = JournalDetail.new(:property => 'attr', :prop_key => 'estimated_hours',
:old_value => '5', :value => '6.3')
assert_match '5.00', show_detail(detail, true)
assert_match '6.30', show_detail(detail, true)
assert_match '5:00', show_detail(detail, true)
assert_match '6:18', show_detail(detail, true)
end

test 'show_detail should not show values with a description attribute' do

+ 1
- 1
test/unit/lib/redmine/i18n_test.rb Visa fil

@@ -158,7 +158,7 @@ class Redmine::I18nTest < ActiveSupport::TestCase

def test_l_hours_short
set_language_if_valid 'en'
assert_equal '2.00 h', l_hours_short(2.0)
assert_equal '2:00 h', l_hours_short(2.0)
end

def test_number_to_currency_default

+ 1
- 1
test/unit/lib/redmine/views/labelled_form_builder_test.rb Visa fil

@@ -35,7 +35,7 @@ class Redmine::Views::LabelledFormBuilderTest < Redmine::HelperTest
entry.validate

labelled_form_for(entry) do |f|
assert_include 'value="2.50"', f.hours_field(:hours)
assert_include 'value="2:30"', f.hours_field(:hours)
end
end


Laddar…
Avbryt
Spara