diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-08 09:00:01 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-08 09:00:01 +0000 |
commit | 0756ea42e41fbfed1994ae63ac6df9e3991dc658 (patch) | |
tree | cdeda1d39a46cc074f977e087766a2dd0a64f0b4 /test/functional/gantts_controller_test.rb | |
parent | 391a9469d1c9b72f14114a6019a4c19d499ee389 (diff) | |
download | redmine-0756ea42e41fbfed1994ae63ac6df9e3991dc658.tar.gz redmine-0756ea42e41fbfed1994ae63ac6df9e3991dc658.zip |
Test for r18136 (#14654).
Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18137 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/gantts_controller_test.rb')
-rw-r--r-- | test/functional/gantts_controller_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb index 4ef4bdac6..dc1975257 100644 --- a/test/functional/gantts_controller_test.rb +++ b/test/functional/gantts_controller_test.rb @@ -161,4 +161,28 @@ class GanttsControllerTest < Redmine::ControllerTest assert_equal 'image/png', @response.content_type end end + + def test_gantt_should_respect_gantt_months_limit_setting + with_settings :gantt_months_limit => '40' do + # `months` parameter can be less than or equal to + # `Setting.gantt_months_limit` + get :show, :params => { + :project_id => 1, + :zoom => 4, + :months => 40 + } + assert_response :success + assert_select 'div.gantt_hdr>a', :text => /^[\d-]+$/, :count => 40 + + # Displays 6 months (the default value for `months`) if `months` exceeds + # gant_months_limit + get :show, :params => { + :project_id => 1, + :zoom => 4, + :months => 41 + } + assert_response :success + assert_select 'div.gantt_hdr>a', :text => /^[\d-]+$/, :count => 6 + end + end end |