summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-09-09 08:57:29 +0000
committerGo MAEDA <maeda@farend.jp>2019-09-09 08:57:29 +0000
commit780e64a100d620574b0afa3cd8317dc4255344ad (patch)
treea432eaf352199f3d93bf97e3718e9b55d9c0aae8 /test/integration
parent3ca75647dfbc3c41f11f202b436a1463cca8236c (diff)
downloadredmine-780e64a100d620574b0afa3cd8317dc4255344ad.tar.gz
redmine-780e64a100d620574b0afa3cd8317dc4255344ad.zip
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
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/news_test.rb20
1 files changed, 20 insertions, 0 deletions
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