Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -25,16 +27,42 @@ class GanttsControllerTest < Redmine::ControllerTest
|
|||
:member_roles,
|
||||
:members,
|
||||
:enabled_modules,
|
||||
:versions
|
||||
:versions,
|
||||
:email_addresses
|
||||
|
||||
def test_gantt_should_work
|
||||
i2 = Issue.find(2)
|
||||
i2.update_attribute(:due_date, 1.month.from_now)
|
||||
get :show, :params => {
|
||||
:project_id => 1
|
||||
}
|
||||
with_settings :gravatar_enabled => '1' do
|
||||
get :show, :params => {
|
||||
:project_id => 1
|
||||
}
|
||||
end
|
||||
assert_response :success
|
||||
|
||||
# query form
|
||||
assert_select 'form#query_form' do
|
||||
assert_select 'div#query_form_with_buttons.hide-when-print' do
|
||||
assert_select 'div#query_form_content' do
|
||||
assert_select 'fieldset#filters.collapsible'
|
||||
assert_select 'fieldset#options'
|
||||
end
|
||||
assert_select 'p.contextual' do
|
||||
prev_month, next_month = User.current.today.prev_month, User.current.today.next_month
|
||||
assert_select 'a[accesskey="p"][href=?]', project_gantt_path(:project_id => 1, :month => prev_month.month, :year => prev_month.year)
|
||||
assert_select 'a[accesskey="n"][href=?]', project_gantt_path(:project_id => 1, :month => next_month.month, :year => next_month.year)
|
||||
end
|
||||
assert_select 'p.buttons'
|
||||
end
|
||||
end
|
||||
|
||||
# Assert context menu on issues subject and gantt bar
|
||||
assert_select 'div[class=?]', 'issue-subject hascontextmenu'
|
||||
assert_select 'div.tooltip.hascontextmenu' do
|
||||
assert_select 'img[class="gravatar"]'
|
||||
end
|
||||
assert_select "form[data-cm-url=?]", '/issues/context_menu'
|
||||
|
||||
# Issue with start and due dates
|
||||
i = Issue.find(1)
|
||||
assert_not_nil i.due_date
|
||||
|
@ -127,7 +155,7 @@ class GanttsControllerTest < Redmine::ControllerTest
|
|||
assert @response.body.starts_with?('%PDF')
|
||||
end
|
||||
|
||||
if Object.const_defined?(:Magick)
|
||||
if Object.const_defined?(:MiniMagick)
|
||||
def test_gantt_should_export_to_png
|
||||
get :show, :params => {
|
||||
:project_id => 1,
|
||||
|
@ -137,4 +165,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue