diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-24 12:18:29 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-24 12:18:29 +0000 |
commit | 0a6a7f0ed7be045640f98cbb14a61588995670c1 (patch) | |
tree | 96fd29043b527f70adcb986fb211470f1ec2a719 /test | |
parent | e37ee0d21b1bb9fc1ff082c4303c8dfb26bc8ce0 (diff) | |
download | redmine-0a6a7f0ed7be045640f98cbb14a61588995670c1.tar.gz redmine-0a6a7f0ed7be045640f98cbb14a61588995670c1.zip |
Fixed that time entries report by week breaks on edge cases (#5329).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11471 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/time_entry_reports_controller_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/time_entry_reports_controller_test.rb b/test/functional/time_entry_reports_controller_test.rb index 759d5d19b..76013614e 100644 --- a/test/functional/time_entry_reports_controller_test.rb +++ b/test/functional/time_entry_reports_controller_test.rb @@ -125,6 +125,32 @@ class TimeEntryReportsControllerTest < ActionController::TestCase :attributes => {:action => "/projects/ecookbook/issues/1/time_entries/report", :id => 'query_form'} end + def test_report_by_week_should_use_commercial_year + TimeEntry.delete_all + TimeEntry.generate!(:hours => '2', :spent_on => '2009-12-25') # 2009-52 + TimeEntry.generate!(:hours => '4', :spent_on => '2009-12-31') # 2009-53 + TimeEntry.generate!(:hours => '8', :spent_on => '2010-01-01') # 2009-53 + TimeEntry.generate!(:hours => '16', :spent_on => '2010-01-05') # 2010-1 + + get :report, :columns => 'week', :from => "2009-12-25", :to => "2010-01-05", :criteria => ["project"] + assert_response :success + + assert_select '#time-report thead tr' do + assert_select 'th:nth-child(1)', :text => 'Project' + assert_select 'th:nth-child(2)', :text => '2009-52' + assert_select 'th:nth-child(3)', :text => '2009-53' + assert_select 'th:nth-child(4)', :text => '2010-1' + assert_select 'th:nth-child(5)', :text => 'Total' + 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 + end + end + def test_report_should_propose_association_custom_fields get :report assert_response :success |