summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-02-18 08:08:10 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-02-18 08:08:10 +0000
commit9f822657820fb87675698d9e6151e7dc650e099f (patch)
tree3967c16c095e04a24650e535a41699a69d14e091 /test/integration/api_test
parentd8263dcdee13b27ea4ac56c28d10dc2ca7fb8b40 (diff)
downloadredmine-9f822657820fb87675698d9e6151e7dc650e099f.tar.gz
redmine-9f822657820fb87675698d9e6151e7dc650e099f.zip
Fix WikiContentVersion API returns 500 if author is nil (#36494).
git-svn-id: http://svn.redmine.org/redmine/trunk@21414 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/wiki_pages_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/integration/api_test/wiki_pages_test.rb b/test/integration/api_test/wiki_pages_test.rb
index 0b81c4341..8caa75f7e 100644
--- a/test/integration/api_test/wiki_pages_test.rb
+++ b/test/integration/api_test/wiki_pages_test.rb
@@ -126,6 +126,17 @@ class Redmine::ApiTest::WikiPagesTest < Redmine::ApiTest::Base
assert_equal 'jsmith', page.content.author.login
end
+ test "GET /projects/:project_id/wiki/:title/:version.xml should not includ author if not exists" do
+ WikiContentVersion.find_by_id(2).update(author_id: nil)
+
+ get '/projects/ecookbook/wiki/CookBook_documentation/2.xml'
+ assert_response 200
+ assert_equal 'application/xml', response.media_type
+ assert_select 'wiki_page' do
+ assert_select 'author', 0
+ end
+ end
+
test "PUT /projects/:project_id/wiki/:title.xml with current versino should update wiki page" do
assert_no_difference 'WikiPage.count' do
assert_difference 'WikiContentVersion.count' do