mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-31 04:39:40 +00:00
Merged r3009 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@3046 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b19ba93966
commit
3d926660ba
@ -88,7 +88,7 @@ class TimelogController < ApplicationController
|
||||
sql << " WHERE"
|
||||
sql << " (%s) AND" % @project.project_condition(Setting.display_subprojects_issues?) if @project
|
||||
sql << " (%s) AND" % Project.allowed_to_condition(User.current, :view_time_entries)
|
||||
sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from.to_time), ActiveRecord::Base.connection.quoted_date(@to.to_time)]
|
||||
sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from), ActiveRecord::Base.connection.quoted_date(@to)]
|
||||
sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek, spent_on"
|
||||
|
||||
@hours = ActiveRecord::Base.connection.select_all(sql)
|
||||
|
||||
@ -147,6 +147,14 @@ class TimelogControllerTest < Test::Unit::TestCase
|
||||
assert_equal "162.90", "%.2f" % assigns(:total_hours)
|
||||
end
|
||||
|
||||
def test_report_one_day
|
||||
get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
|
||||
assert_response :success
|
||||
assert_template 'report'
|
||||
assert_not_nil assigns(:total_hours)
|
||||
assert_equal "4.25", "%.2f" % assigns(:total_hours)
|
||||
end
|
||||
|
||||
def test_report_custom_field_criteria
|
||||
get :report, :project_id => 1, :criterias => ['project', 'cf_1']
|
||||
assert_response :success
|
||||
@ -238,6 +246,14 @@ class TimelogControllerTest < Test::Unit::TestCase
|
||||
assert_equal Date.today - 7, assigns(:from)
|
||||
assert_equal Date.today, assigns(:to)
|
||||
end
|
||||
|
||||
def test_details_one_day
|
||||
get :details, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
|
||||
assert_response :success
|
||||
assert_template 'details'
|
||||
assert_not_nil assigns(:total_hours)
|
||||
assert_equal "4.25", "%.2f" % assigns(:total_hours)
|
||||
end
|
||||
|
||||
def test_details_at_issue_level
|
||||
get :details, :issue_id => 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user