From 9d65eee4248acef921d102f1e614618514afcd51 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 20 Jan 2023 03:31:41 +0000 Subject: Avoid double-render error with ApplicationController#find_optional_project (#38063). Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@22066 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/application_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/integration') diff --git a/test/integration/application_test.rb b/test/integration/application_test.rb index d6caac41a..f80e9f81a 100644 --- a/test/integration/application_test.rb +++ b/test/integration/application_test.rb @@ -96,4 +96,19 @@ class ApplicationTest < Redmine::IntegrationTest assert_response 302 end end + + def test_find_optional_project_should_not_error + Role.anonymous.remove_permission! :view_gantt + with_settings :login_required => '0' do + get '/projects/nonexistingproject/issues/gantt' + assert_response 302 + end + end + + def test_find_optional_project_should_render_404_for_logged_users + log_user('jsmith', 'jsmith') + + get '/projects/nonexistingproject/issues/gantt' + assert_response 404 + end end -- cgit v1.2.3