mirror of
https://github.com/redmine/redmine.git
synced 2026-03-02 10:31:33 +01:00
REST API for deleting news (#13468).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18442 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -263,4 +263,24 @@ class Redmine::ApiTest::NewsTest < Redmine::ApiTest::Base
|
||||
news = News.find_by(:title => 'News JSON-API with attachments')
|
||||
assert_equal 2, news.attachments.count
|
||||
end
|
||||
|
||||
test "DELETE /news/:id.xml" do
|
||||
assert_difference('News.count', -1) do
|
||||
delete '/news/1.xml', :headers => credentials('jsmith')
|
||||
|
||||
assert_response :no_content
|
||||
assert_equal '', response.body
|
||||
end
|
||||
assert_nil News.find_by_id(1)
|
||||
end
|
||||
|
||||
test "DELETE /news/:id.json" do
|
||||
assert_difference('News.count', -1) do
|
||||
delete '/news/1.json', :headers => credentials('jsmith')
|
||||
|
||||
assert_response :no_content
|
||||
assert_equal '', response.body
|
||||
end
|
||||
assert_nil News.find_by_id(6)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user