summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-11-03 05:17:48 +0000
committerGo MAEDA <maeda@farend.jp>2022-11-03 05:17:48 +0000
commitfcf1352c6b19f1dcb8872367a1313cbffb551093 (patch)
treecff397005ab0d1e20f1f0a4dfd35d6d4ba017f93 /test/functional
parentf90fd0d236eb35028122013e914076b94b119ad5 (diff)
downloadredmine-fcf1352c6b19f1dcb8872367a1313cbffb551093.tar.gz
redmine-fcf1352c6b19f1dcb8872367a1313cbffb551093.zip
Redirect to container URL in case of error in attachments#download_all (#37880).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21948 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/attachments_controller_test.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 4dbe3ce6e..cb82427cd 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -631,7 +631,23 @@ class AttachmentsControllerTest < Redmine::ControllerTest
:params => {
:object_type => 'issues',
:object_id => '2',
- :back_url => '/issues/2'
+ :back_url => '/issues/123'
+ }
+ )
+ assert_redirected_to '/issues/123'
+ assert_equal flash[:error], 'These attachments cannot be bulk downloaded because the total file size exceeds the maximum allowed size (0 Bytes)'
+ end
+ end
+
+ def test_download_all_redirects_to_container_url_on_error
+ with_settings :bulk_download_max_size => 0 do
+ @request.session[:user_id] = 2
+ get(
+ :download_all,
+ :params => {
+ :object_type => 'issues',
+ :object_id => '2',
+ :back_url => 'https://example.com'
}
)
assert_redirected_to '/issues/2'