summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/helpers/gantt_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/unit/lib/redmine/helpers/gantt_test.rb b/test/unit/lib/redmine/helpers/gantt_test.rb
index f54dfe350..401eabf43 100644
--- a/test/unit/lib/redmine/helpers/gantt_test.rb
+++ b/test/unit/lib/redmine/helpers/gantt_test.rb
@@ -53,9 +53,9 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
end
# Creates a Gantt chart for a 4 week span
- def create_gantt(project=Project.generate!)
+ def create_gantt(project=Project.generate!, options={})
@project = project
- @gantt = Redmine::Helpers::Gantt.new
+ @gantt = Redmine::Helpers::Gantt.new(options)
@gantt.project = @project
@gantt.query = Query.generate_default!(:project => @project)
@gantt.view = build_view
@@ -73,6 +73,22 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
should "return the total number of rows for all the projects, resursively"
end
+ should "not exceed max_rows option" do
+ p = Project.generate!
+ 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
+ assert @gantt.truncated
+ end
end
context "#number_of_rows_on_project" do