#1241 REST API custom fields
This commit is contained in:
parent
77c1667835
commit
7a0a36c536
@ -21,6 +21,7 @@ api.dmsf do
|
|||||||
api.found_folder do
|
api.found_folder do
|
||||||
api.id @folder.id
|
api.id @folder.id
|
||||||
api.title @folder.title
|
api.title @folder.title
|
||||||
|
render_api_custom_values @folder.visible_custom_field_values, api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ api.dmsf_file do
|
|||||||
api.dmsf_workflow_started_by_user_id r.dmsf_workflow_started_by_user_id
|
api.dmsf_workflow_started_by_user_id r.dmsf_workflow_started_by_user_id
|
||||||
api.dmsf_workflow_started_at r.dmsf_workflow_started_at
|
api.dmsf_workflow_started_at r.dmsf_workflow_started_at
|
||||||
api.digest r.digest
|
api.digest r.digest
|
||||||
|
render_api_custom_values r.visible_custom_field_values, api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -88,6 +88,11 @@ class DmsfFileApiTest < RedmineDmsf::Test::IntegrationTest
|
|||||||
# <dmsf_workflow_started_by_user_id>1</dmsf_workflow_started_by_user_id>
|
# <dmsf_workflow_started_by_user_id>1</dmsf_workflow_started_by_user_id>
|
||||||
# <dmsf_workflow_started_at/>
|
# <dmsf_workflow_started_at/>
|
||||||
# <digest>81dc9bdb52d04dc20036dbd8313ed055</digest>
|
# <digest>81dc9bdb52d04dc20036dbd8313ed055</digest>
|
||||||
|
# <custom_fields>
|
||||||
|
# <custom_field>
|
||||||
|
# ...
|
||||||
|
# <suctom_field>
|
||||||
|
# </custom_fields>
|
||||||
# </dmsf_file_revision>
|
# </dmsf_file_revision>
|
||||||
# </dmsf_file_revisions>
|
# </dmsf_file_revisions>
|
||||||
# </dmsf_file>
|
# </dmsf_file>
|
||||||
@ -97,6 +102,7 @@ class DmsfFileApiTest < RedmineDmsf::Test::IntegrationTest
|
|||||||
assert_select 'dmsf_file > project_id', text: @file1.project_id.to_s
|
assert_select 'dmsf_file > project_id', text: @file1.project_id.to_s
|
||||||
assert_select 'dmsf_file > content_url', text: "http://www.example.com/dmsf/files/#{@file1.id}/download"
|
assert_select 'dmsf_file > content_url', text: "http://www.example.com/dmsf/files/#{@file1.id}/download"
|
||||||
assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision', @file1.dmsf_file_revisions.all.size
|
assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision', @file1.dmsf_file_revisions.all.size
|
||||||
|
assert_select 'dmsf_file > dmsf_file_revisions > dmsf_file_revision > custom_fields > custom_field'
|
||||||
#curl -v -H "Content-Type: application/octet-stream" -X GET -u ${1}:${2} http://localhost:3000/dmsf/files/41532/download > file.txt
|
#curl -v -H "Content-Type: application/octet-stream" -X GET -u ${1}:${2} http://localhost:3000/dmsf/files/41532/download > file.txt
|
||||||
get "/dmsf/files/#{@file1.id}/download.xml?key=#{@token.value}"
|
get "/dmsf/files/#{@file1.id}/download.xml?key=#{@token.value}"
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|||||||
@ -168,10 +168,16 @@ class DmsfFolderApiTest < RedmineDmsf::Test::IntegrationTest
|
|||||||
# <found_folder>
|
# <found_folder>
|
||||||
# <id>1</id>
|
# <id>1</id>
|
||||||
# <title>folder1</title>
|
# <title>folder1</title>
|
||||||
|
# <custom_fields>
|
||||||
|
# <custom_field>
|
||||||
|
# ...
|
||||||
|
# <suctom_field>
|
||||||
|
# </custom_fields>
|
||||||
# </found_folder>
|
# </found_folder>
|
||||||
# </dmsf>
|
# </dmsf>
|
||||||
assert_select 'dmsf > found_folder > id', text: @folder1.id.to_s
|
assert_select 'dmsf > found_folder > id', text: @folder1.id.to_s
|
||||||
assert_select 'dmsf > found_folder > title', text: @folder1.title
|
assert_select 'dmsf > found_folder > title', text: @folder1.title
|
||||||
|
assert_select 'dmsf > found_folder > custom_fields > custom_field'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_find_folder_by_id_not_found
|
def test_find_folder_by_id_not_found
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user