mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 07:16:03 +01:00
Adds an application setting to limit the number of items that can be displayed on the gantt chart (#6276).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4513 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user