mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 16:06:58 +02:00
Better message for file size validation error.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8937 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -116,5 +116,16 @@ class ApiTest::AttachmentsTest < ActionController::IntegrationTest
|
||||
assert_response 406
|
||||
end
|
||||
end
|
||||
|
||||
should "return errors if file is too big" do
|
||||
set_tmp_attachments_directory
|
||||
with_settings :attachment_max_size => 1 do
|
||||
assert_no_difference 'Attachment.count' do
|
||||
post '/uploads.xml', ('x' * 2048), {'Content-Type' => 'application/octet-stream'}.merge(credentials('jsmith'))
|
||||
assert_response 422
|
||||
assert_tag 'error', :content => /exceeds the maximum allowed file size/
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user