comparison test/unit/lib/redmine/helpers/gantt_test.rb @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents 622f24f53b42
children
comparison
equal deleted inserted replaced
1297:0a574315af3e 1298:4f746d8966dd
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
24 :projects_trackers, 24 :projects_trackers,
25 :roles, 25 :roles,
26 :member_roles, 26 :member_roles,
27 :members, 27 :members,
28 :enabled_modules, 28 :enabled_modules,
29 :workflows,
30 :versions, 29 :versions,
31 :groups_users 30 :groups_users
32 31
33 include ApplicationHelper 32 include ApplicationHelper
34 include ProjectsHelper 33 include ProjectsHelper
35 include IssuesHelper 34 include IssuesHelper
36 include ERB::Util 35 include ERB::Util
36 include Rails.application.routes.url_helpers
37 37
38 def setup 38 def setup
39 setup_with_controller 39 setup_with_controller
40 User.current = User.find(1) 40 User.current = User.find(1)
41 end 41 end
47 # Creates a Gantt chart for a 4 week span 47 # Creates a Gantt chart for a 4 week span
48 def create_gantt(project=Project.generate!, options={}) 48 def create_gantt(project=Project.generate!, options={})
49 @project = project 49 @project = project
50 @gantt = Redmine::Helpers::Gantt.new(options) 50 @gantt = Redmine::Helpers::Gantt.new(options)
51 @gantt.project = @project 51 @gantt.project = @project
52 @gantt.query = Query.create!(:project => @project, :name => 'Gantt') 52 @gantt.query = IssueQuery.create!(:project => @project, :name => 'Gantt')
53 @gantt.view = self 53 @gantt.view = self
54 @gantt.instance_variable_set('@date_from', options[:date_from] || (today - 14)) 54 @gantt.instance_variable_set('@date_from', options[:date_from] || (today - 14))
55 @gantt.instance_variable_set('@date_to', options[:date_to] || (today + 14)) 55 @gantt.instance_variable_set('@date_to', options[:date_to] || (today + 14))
56 end 56 end
57 57