time_format:
default: ''
timespan_format:
- default: 'decimal'
+ default: 'minutes'
user_format:
default: :firstname_lastname
format: symbol
}
)
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,
}
)
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
: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
: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
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 => {
)
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
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
:priority_id => 7
},
:time_entry => {
- :hours => '2.5',
+ :hours => '2:30',
:comments => 'test_get_edit_with_params',
:activity_id => 10
}
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
:subject => ''
},
:time_entry => {
- :hours => '2.5',
+ :hours => '2:30',
:comments => 'should not be added',
:activity_id => TimeEntryActivity.first.id
}
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
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
@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
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
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
@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"
@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
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
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
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
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
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
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
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
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'
# 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
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
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
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
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
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