From 780e64a100d620574b0afa3cd8317dc4255344ad Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 9 Sep 2019 08:57:29 +0000 Subject: 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 --- test/integration/api_test/news_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/integration') diff --git a/test/integration/api_test/news_test.rb b/test/integration/api_test/news_test.rb index 48a0b1025..0ec7824d2 100644 --- a/test/integration/api_test/news_test.rb +++ b/test/integration/api_test/news_test.rb @@ -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 -- cgit v1.2.3