Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

View file

@ -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
@ -35,6 +37,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
:attachments
def setup
User.current = nil
set_tmp_attachments_directory
@field = IssueCustomField.generate!(:name => "File", :field_format => "attachment")
log_user "jsmith", "jsmith"
@ -85,7 +88,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
# preview the attachment
get link.attr('href')
assert_response :success
assert_template :file
assert_select 'h2', :text => "#{issue.tracker} ##{issue.id} » testfile.txt"
end
def test_create_without_attachment

View file

@ -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
@ -37,14 +39,14 @@ class HookTest < Redmine::IntegrationTest
Redmine::Hook.clear_listeners
class ContentForInsideHook < Redmine::Hook::ViewListener
render_on :view_welcome_index_left, :inline => <<-VIEW
<% content_for :header_tags do %>
<%= javascript_include_tag 'test_plugin.js', :plugin => 'test_plugin' %>
<%= stylesheet_link_tag 'test_plugin.css', :plugin => 'test_plugin' %>
<% end %>
render_on :view_welcome_index_left, :inline => <<~VIEW
<% content_for :header_tags do %>
<%= javascript_include_tag 'test_plugin.js', :plugin => 'test_plugin' %>
<%= stylesheet_link_tag 'test_plugin.css', :plugin => 'test_plugin' %>
<% end %>
<p>ContentForInsideHook content</p>
VIEW
<p>ContentForInsideHook content</p>
VIEW
end
class SingleRenderOn < Redmine::Hook::ViewListener

View file

@ -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
@ -30,7 +32,7 @@ class MenuManagerTest < Redmine::IntegrationTest
def test_project_menu_with_specific_locale
get '/projects/ecookbook/issues',
:headers => {'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'}
:headers => {'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'}
assert_select 'div#main-menu' do
assert_select 'li a.activity[href=?]', '/projects/ecookbook/activity', :text => ll('fr', :label_activity)
@ -77,4 +79,37 @@ class MenuManagerTest < Redmine::IntegrationTest
get '/login'
assert_select '#main-menu', 0
end
def test_body_should_have_main_menu_css_class_if_main_menu_is_present
get '/projects'
assert_select 'body.has-main-menu'
get '/'
assert_select 'body.has-main-menu', 0
end
def test_cross_project_menu_should_hide_item_if_module_is_not_enabled_for_any_project
user = User.find_by_login('dlopper')
assert_equal [1, 3, 4, 6], Project.visible(user).ids
# gantt and news are not enabled for any visible project
Project.find(1).enabled_module_names = %w(issue_tracking calendar)
Project.find(3).enabled_module_names = %w(time_tracking)
EnabledModule.where(:project_id => [4, 6]).delete_all
log_user('dlopper', 'foo')
get '/projects'
assert_select '#main-menu' do
assert_select 'a.projects', :count => 1
assert_select 'a.activity', :count => 1
assert_select 'a.issues', :count => 1 # issue_tracking
assert_select 'a.time-entries', :count => 1 # time_tracking
assert_select 'a.gantt', :count => 0 # gantt
assert_select 'a.calendar', :count => 1 # calendar
assert_select 'a.news', :count => 0 # news
end
assert_select '#projects-index' do
assert_select 'a.project', :count => 4
end
end
end

View file

@ -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
@ -57,6 +59,7 @@ class ThemesTest < Redmine::IntegrationTest
end
def test_use_default_favicon_if_theme_provides_none
@theme.favicons.clear
get '/'
assert_response :success
@ -65,7 +68,7 @@ class ThemesTest < Redmine::IntegrationTest
def test_use_theme_favicon_if_theme_provides_one
# Simulate a theme favicon
@theme.favicons << 'a.ico'
@theme.favicons.unshift('a.ico')
get '/'
assert_response :success
@ -75,7 +78,7 @@ class ThemesTest < Redmine::IntegrationTest
end
def test_use_only_one_theme_favicon_if_theme_provides_many
@theme.favicons.concat %w{b.ico a.png}
@theme.favicons.unshift('b.ico', 'a.png')
get '/'
assert_response :success
@ -88,8 +91,8 @@ class ThemesTest < Redmine::IntegrationTest
def test_with_sub_uri
Redmine::Utils.relative_url_root = '/foo'
@theme.javascripts << 'theme'
@theme.favicons << 'a.ico'
@theme.javascripts.unshift('theme')
@theme.favicons.unshift('a.ico')
get '/'
assert_response :success