summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-23 12:18:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-23 12:18:10 +0000
commit7e347069d5607a329de2bcfd77dbbb9c2e345630 (patch)
tree4572a49e89716e39a2dbf7017e7d4cef1a5329d6 /test/integration/api_test
parent9774782cab726d61cc6a4ed9298847f5006c0439 (diff)
downloadredmine-7e347069d5607a329de2bcfd77dbbb9c2e345630.tar.gz
redmine-7e347069d5607a329de2bcfd77dbbb9c2e345630.zip
Better message for file size validation error.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8937 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/attachments_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb
index 16fc531a3..5e20449d4 100644
--- a/test/integration/api_test/attachments_test.rb
+++ b/test/integration/api_test/attachments_test.rb
@@ -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