##// END OF EJS Templates
Fixed: error on gantt when no issue have a due date (#6350)....
Jean-Philippe Lang -
r4166:ed608cb7d39f
parent child
Show More
@@ -283,8 +283,8 module Redmine
283 283 end
284 284
285 285 def line_for_project(project, options)
286 # Skip versions that don't have a start_date
287 if project.is_a?(Project) && project.start_date
286 # Skip versions that don't have a start_date or due date
287 if project.is_a?(Project) && project.start_date && project.due_date
288 288 options[:zoom] ||= 1
289 289 options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
290 290
@@ -419,7 +419,7 module Redmine
419 419
420 420 def line_for_version(version, options)
421 421 # Skip versions that don't have a start_date
422 if version.is_a?(Version) && version.start_date
422 if version.is_a?(Version) && version.start_date && version.due_date
423 423 options[:zoom] ||= 1
424 424 options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
425 425
@@ -21,7 +21,7 class GanttsControllerTest < ActionController::TestCase
21 21 assert_select "div a.issue", /##{i.id}/
22 22 end
23 23
24 should_eventually "work without issue due dates" do
24 should "work without issue due dates" do
25 25 Issue.update_all("due_date = NULL")
26 26
27 27 get :show, :project_id => 1
@@ -29,6 +29,16 class GanttsControllerTest < ActionController::TestCase
29 29 assert_template 'show.html.erb'
30 30 assert_not_nil assigns(:gantt)
31 31 end
32
33 should "work without issue and version due dates" do
34 Issue.update_all("due_date = NULL")
35 Version.update_all("effective_date = NULL")
36
37 get :show, :project_id => 1
38 assert_response :success
39 assert_template 'show.html.erb'
40 assert_not_nil assigns(:gantt)
41 end
32 42
33 43 should "work cross project" do
34 44 get :show
General Comments 0
You need to be logged in to leave comments. Login now