Feature #14654 » test-for-14654.patch
| test/functional/gantts_controller_test.rb | ||
|---|---|---|
| 161 | 161 |
assert_equal 'image/png', @response.content_type |
| 162 | 162 |
end |
| 163 | 163 |
end |
| 164 | ||
| 165 |
def test_gantt_should_respect_gantt_months_limit_setting |
|
| 166 |
with_settings :gantt_months_limit => '40' do |
|
| 167 |
# `months` parameter can be less than or equal to |
|
| 168 |
# `Setting.gantt_months_limit` |
|
| 169 |
get :show, :params => {
|
|
| 170 |
:project_id => 1, |
|
| 171 |
:zoom => 4, |
|
| 172 |
:months => 40 |
|
| 173 |
} |
|
| 174 |
assert_response :success |
|
| 175 |
assert_select 'div.gantt_hdr>a', :text => /^[\d-]+$/, :count => 40 |
|
| 176 | ||
| 177 |
# Displays 6 months (the default value for `months`) if `months` exceeds |
|
| 178 |
# gant_months_limit |
|
| 179 |
get :show, :params => {
|
|
| 180 |
:project_id => 1, |
|
| 181 |
:zoom => 4, |
|
| 182 |
:months => 41 |
|
| 183 |
} |
|
| 184 |
assert_response :success |
|
| 185 |
assert_select 'div.gantt_hdr>a', :text => /^[\d-]+$/, :count => 6 |
|
| 186 |
end |
|
| 187 |
end |
|
| 164 | 188 |
end |