summaryrefslogtreecommitdiffstats
path: root/test/functional/timelog_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-01 19:40:40 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-01 19:40:40 +0000
commit043cb37b161d712e1c6fe7b9aa41d7af356cf795 (patch)
tree4bef33fa384a7bcc82446fabc0e8bfd4a50617ca /test/functional/timelog_controller_test.rb
parente4da9d6f10edda72211b63659ab938a5ad7f0cda (diff)
downloadredmine-043cb37b161d712e1c6fe7b9aa41d7af356cf795.tar.gz
redmine-043cb37b161d712e1c6fe7b9aa41d7af356cf795.zip
Add predefined date ranges to the time report in the same way as the details view (closes #972). It nows defaults to 'All time'.
This patch also fixes time report periods (columns) computation. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1318 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/timelog_controller_test.rb')
-rw-r--r--test/functional/timelog_controller_test.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index fa4432295..9ca1a6cbf 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -78,17 +78,25 @@ class TimelogControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'report'
end
-
+
+ def test_report_all_time
+ get :report, :project_id => 1, :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ end
+
def test_report_one_criteria
- get :report, :project_id => 1, :period => 'week', :date_from => "2007-04-01", :date_to => "2007-04-30", :criterias => ['project']
+ get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
assert_response :success
assert_template 'report'
assert_not_nil assigns(:total_hours)
assert_equal "8.65", "%.2f" % assigns(:total_hours)
- end
+ end
def test_report_two_criterias
- get :report, :project_id => 1, :period => 'month', :date_from => "2007-01-01", :date_to => "2007-12-31", :criterias => ["member", "activity"]
+ get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
assert_response :success
assert_template 'report'
assert_not_nil assigns(:total_hours)
@@ -96,7 +104,7 @@ class TimelogControllerTest < Test::Unit::TestCase
end
def test_report_one_criteria_no_result
- get :report, :project_id => 1, :period => 'week', :date_from => "1998-04-01", :date_to => "1998-04-30", :criterias => ['project']
+ get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project']
assert_response :success
assert_template 'report'
assert_not_nil assigns(:total_hours)