end
context "#number_of_rows" do
-
context "with one project" do
should "return the number of rows just for that project"
end
5.times do
Issue.generate_for_project!(p)
end
-
create_gantt(p)
@gantt.render
assert_equal 6, @gantt.number_of_rows
assert !@gantt.truncated
-
create_gantt(p, :max_rows => 3)
@gantt.render
assert_equal 3, @gantt.number_of_rows
version = Version.generate!
@project.versions << version
@project.issues << Issue.generate_for_project!(@project, :fixed_version => version)
-
assert_equal 3, @gantt.number_of_rows_on_project(@project)
end
end
@project.trackers << @tracker
@version = Version.generate!(:effective_date => (today + 7), :sharing => 'none')
@project.versions << @version
-
@issue = Issue.generate!(:fixed_version => @version,
:subject => "gantt#line_for_project",
:tracker => @tracker,
context "without assigned issues" do
setup do
- @version = Version.generate!(:effective_date => (today + 14), :sharing => 'none', :name => 'empty_version')
+ @version = Version.generate!(:effective_date => (today + 14),
+ :sharing => 'none',
+ :name => 'empty_version')
@project.versions << @version
end
@shared_version = Version.generate!(:sharing => 'system')
p.versions << @shared_version
# Reassign the issue to a shared version of another project
-
@issue = Issue.generate!(:fixed_version => @shared_version,
:subject => "gantt#assigned_to_shared_version",
:tracker => @tracker,
context "with subtasks" do
setup do
attrs = {:project => @project, :tracker => @tracker, :fixed_version => @version}
- @child1 = Issue.generate!(attrs.merge(:subject => 'child1', :parent_issue_id => @issue.id, :start_date => (today - 1), :due_date => (today + 2)))
- @child2 = Issue.generate!(attrs.merge(:subject => 'child2', :parent_issue_id => @issue.id, :start_date => today, :due_date => (today + 7)))
- @grandchild = Issue.generate!(attrs.merge(:subject => 'grandchild', :parent_issue_id => @child1.id, :start_date => (today - 1), :due_date => (today + 2)))
+ @child1 = Issue.generate!(
+ attrs.merge(:subject => 'child1',
+ :parent_issue_id => @issue.id,
+ :start_date => (today - 1),
+ :due_date => (today + 2))
+ )
+ @child2 = Issue.generate!(
+ attrs.merge(:subject => 'child2',
+ :parent_issue_id => @issue.id,
+ :start_date => today,
+ :due_date => (today + 7))
+ )
+ @grandchild = Issue.generate!(
+ attrs.merge(:subject => 'grandchild',
+ :parent_issue_id => @child1.id,
+ :start_date => (today - 1),
+ :due_date => (today + 2))
+ )
end
should "indent subtasks" do
:start_date => (today - 1),
:due_date => (today + 7))
@project.issues << @issue
-
@output_buffer = @gantt.lines
end
should "style overdue projects" do
@project.enabled_module_names = [:issue_tracking]
@project.versions << Version.generate!(:effective_date => (today - 1))
-
assert @project.reload.overdue?, "Need an overdue project for this test"
@output_buffer = @gantt.subject_for_project(@project, {:format => :html})
-
assert_select 'div span.project-overdue'
end
-
-
end
-
should "test the PNG format"
should "test the PDF format"
end
@project.trackers << @tracker
@version = Version.generate!(:effective_date => (today - 1))
@project.versions << @version
-
@project.issues << Issue.generate!(:fixed_version => @version,
:subject => "gantt#line_for_project",
:tracker => @tracker,
@output_buffer = @gantt.line_for_project(@project, {:format => :html, :zoom => 4})
assert_select "div.project.task_todo[style*=width:58px]", true, @output_buffer
end
-
end
context "late line" do
should "not appear if the starting point is off the gantt chart" do
# Shift the date range of the chart
@gantt.instance_variable_set('@date_from', today)
-
@output_buffer = @gantt.line_for_project(@project, {:format => :html, :zoom => 4})
assert_select "div.project.starting", false, @output_buffer
end
should "not appear if the starting point is off the gantt chart" do
# Shift the date range of the chart
@gantt.instance_variable_set('@date_to', (today - 14))
-
@output_buffer = @gantt.line_for_project(@project, {:format => :html, :zoom => 4})
assert_select "div.project.ending", false, @output_buffer
-
end
should "appear at the end of the date range" do
end
end
end
-
should "test the PNG format"
should "test the PDF format"
end
should "style late versions" do
assert @version.overdue?, "Need an overdue version for this test"
@output_buffer = @gantt.subject_for_version(@version, {:format => :html})
-
assert_select 'div span.version-behind-schedule'
end
should "style behind schedule versions" do
assert @version.behind_schedule?, "Need a behind schedule version for this test"
@output_buffer = @gantt.subject_for_version(@version, {:format => :html})
-
assert_select 'div span.version-behind-schedule'
end
end
@project.trackers << @tracker
@version = Version.generate!(:effective_date => (today + 7))
@project.versions << @version
-
@project.issues << Issue.generate!(:fixed_version => @version,
:subject => "gantt#line_for_project",
:tracker => @tracker,
should "not appear if the starting point is off the gantt chart" do
# Shift the date range of the chart
@gantt.instance_variable_set('@date_from', today)
-
@output_buffer = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
assert_select "div.version.starting", false
end
should "not appear if the starting point is off the gantt chart" do
# Shift the date range of the chart
@gantt.instance_variable_set('@date_to', (today - 14))
-
@output_buffer = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
assert_select "div.version.ending", false
-
end
should "appear at the end of the date range" do
context "status content" do
should "appear at the far left, even if it's far in the past" do
@gantt.instance_variable_set('@date_to', (today - 14))
-
@output_buffer = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
assert_select "div.version.label", /#{@version.name}/
end
end
end
end
-
should "test the PNG format"
should "test the PDF format"
end
@project.enabled_module_names = [:issue_tracking]
@tracker = Tracker.generate!
@project.trackers << @tracker
-
@issue = Issue.generate!(:subject => "gantt#subject_for_issue",
:tracker => @tracker,
:project => @project,
:start_date => (today - 3),
:due_date => (today - 1))
@project.issues << @issue
-
end
context ":html format" do
should "style overdue issues" do
assert @issue.overdue?, "Need an overdue issue for this test"
@output_buffer = @gantt.subject_for_issue(@issue, {:format => :html})
-
assert_select 'div span.issue-overdue'
end
-
end
should "test the PNG format"
should "test the PDF format"
@output_buffer = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
assert_select "div.task_todo[style*=width:58px]", true, @output_buffer
end
-
end
context "late line" do
context "status content" do
should "appear at the far left, even if it's far in the past" do
@gantt.instance_variable_set('@date_to', (today - 14))
-
@output_buffer = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
assert_select "div.task.label", true, @output_buffer
end
@output_buffer = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
assert_select "div.tooltip", /#{@issue.subject}/
end
-
should "test the PNG format"
should "test the PDF format"
end
context "#to_pdf" do
should "be tested"
end
-
end