##// END OF EJS Templates
Merged r3009 from trunk....
Eric Davis -
r2932:3d926660ba01
parent child
Show More
@@ -88,7 +88,7 class TimelogController < ApplicationController
88 88 sql << " WHERE"
89 89 sql << " (%s) AND" % @project.project_condition(Setting.display_subprojects_issues?) if @project
90 90 sql << " (%s) AND" % Project.allowed_to_condition(User.current, :view_time_entries)
91 sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from.to_time), ActiveRecord::Base.connection.quoted_date(@to.to_time)]
91 sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from), ActiveRecord::Base.connection.quoted_date(@to)]
92 92 sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek, spent_on"
93 93
94 94 @hours = ActiveRecord::Base.connection.select_all(sql)
@@ -147,6 +147,14 class TimelogControllerTest < Test::Unit::TestCase
147 147 assert_equal "162.90", "%.2f" % assigns(:total_hours)
148 148 end
149 149
150 def test_report_one_day
151 get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
152 assert_response :success
153 assert_template 'report'
154 assert_not_nil assigns(:total_hours)
155 assert_equal "4.25", "%.2f" % assigns(:total_hours)
156 end
157
150 158 def test_report_custom_field_criteria
151 159 get :report, :project_id => 1, :criterias => ['project', 'cf_1']
152 160 assert_response :success
@@ -238,6 +246,14 class TimelogControllerTest < Test::Unit::TestCase
238 246 assert_equal Date.today - 7, assigns(:from)
239 247 assert_equal Date.today, assigns(:to)
240 248 end
249
250 def test_details_one_day
251 get :details, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
252 assert_response :success
253 assert_template 'details'
254 assert_not_nil assigns(:total_hours)
255 assert_equal "4.25", "%.2f" % assigns(:total_hours)
256 end
241 257
242 258 def test_details_at_issue_level
243 259 get :details, :issue_id => 1
General Comments 0
You need to be logged in to leave comments. Login now