summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-12 19:18:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-12 19:18:34 +0000
commit130424fc3ed627142f487b495cfa70701e313939 (patch)
tree5f086c7d3c079bf007679b9b6f6c233202c8248e /test
parentdfb78be2a7d79925d35b1c25bf9a86f36f188cd9 (diff)
downloadredmine-130424fc3ed627142f487b495cfa70701e313939.tar.gz
redmine-130424fc3ed627142f487b495cfa70701e313939.zip
Support for deleting attachments via API (#14828).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@15332 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/api_test/attachments_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb
index 4ec4c84a7..640a78290 100644
--- a/test/integration/api_test/attachments_test.rb
+++ b/test/integration/api_test/attachments_test.rb
@@ -81,6 +81,24 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
assert_response :success
end
+ test "Destroy /attachments/:id.xml should return ok and deleted Attachment" do
+ assert_difference 'Attachment.count', -1 do
+ delete '/attachments/7.xml', {}, credentials('jsmith')
+ assert_response :ok
+ assert_equal '', response.body
+ end
+ assert_nil Attachment.find_by_id(7)
+ end
+
+ test "Destroy /attachments/:id.json should return ok and deleted Attachment" do
+ assert_difference 'Attachment.count', -1 do
+ delete '/attachments/7.json', {}, credentials('jsmith')
+ assert_response :ok
+ assert_equal '', response.body
+ end
+ assert_nil Attachment.find_by_id(7)
+ end
+
test "POST /uploads.xml should return the token" do
set_tmp_attachments_directory
assert_difference 'Attachment.count' do