summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 13:24:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 13:24:18 +0000
commit30fc03ac32590ce515be213e7191a579e0da62d4 (patch)
tree372d9e61b47ad1a071c769f439980167898b2ce9 /test/integration/api_test
parent696c51085246058408c5f709927df8db07b90d54 (diff)
downloadredmine-30fc03ac32590ce515be213e7191a579e0da62d4.tar.gz
redmine-30fc03ac32590ce515be213e7191a579e0da62d4.zip
Adds a routing test for deleting attachment via the API.
git-svn-id: http://svn.redmine.org/redmine/trunk@15862 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/api_routing_test.rb1
-rw-r--r--test/integration/api_test/attachments_test.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/test/integration/api_test/api_routing_test.rb b/test/integration/api_test/api_routing_test.rb
index 5e686a9e2..8d15e35a5 100644
--- a/test/integration/api_test/api_routing_test.rb
+++ b/test/integration/api_test/api_routing_test.rb
@@ -22,6 +22,7 @@ class Redmine::ApiTest::ApiRoutingTest < Redmine::ApiTest::Routing
def test_attachments
should_route 'GET /attachments/1' => 'attachments#show', :id => '1'
should_route 'PATCH /attachments/1' => 'attachments#update', :id => '1'
+ should_route 'DELETE /attachments/1' => 'attachments#destroy', :id => '1'
should_route 'POST /uploads' => 'attachments#upload'
end
diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb
index 312920922..4188d7116 100644
--- a/test/integration/api_test/attachments_test.rb
+++ b/test/integration/api_test/attachments_test.rb
@@ -81,7 +81,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
assert_response :success
end
- test "Destroy /attachments/:id.xml should return ok and deleted Attachment" do
+ test "DELETE /attachments/:id.xml should return ok and delete Attachment" do
assert_difference 'Attachment.count', -1 do
delete '/attachments/7.xml', {}, credentials('jsmith')
assert_response :ok
@@ -90,7 +90,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
assert_nil Attachment.find_by_id(7)
end
- test "Destroy /attachments/:id.json should return ok and deleted Attachment" do
+ test "DELETE /attachments/:id.json should return ok and delete Attachment" do
assert_difference 'Attachment.count', -1 do
delete '/attachments/7.json', {}, credentials('jsmith')
assert_response :ok