end
def line_for_project(project, options)
- # Skip versions that don't have a start_date
- if project.is_a?(Project) && project.start_date
+ # Skip versions that don't have a start_date or due date
+ if project.is_a?(Project) && project.start_date && project.due_date
options[:zoom] ||= 1
options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
def line_for_version(version, options)
# Skip versions that don't have a start_date
- if version.is_a?(Version) && version.start_date
+ if version.is_a?(Version) && version.start_date && version.due_date
options[:zoom] ||= 1
options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
assert_select "div a.issue", /##{i.id}/
end
- should_eventually "work without issue due dates" do
+ should "work without issue due dates" do
Issue.update_all("due_date = NULL")
get :show, :project_id => 1
assert_template 'show.html.erb'
assert_not_nil assigns(:gantt)
end
+
+ should "work without issue and version due dates" do
+ Issue.update_all("due_date = NULL")
+ Version.update_all("effective_date = NULL")
+
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'show.html.erb'
+ assert_not_nil assigns(:gantt)
+ end
should "work cross project" do
get :show