mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
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
This commit is contained in:
parent
696c510852
commit
30fc03ac32
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user