Ability to retrieve the MD5 value of a Document #755
This commit is contained in:
parent
9e9d1250aa
commit
b042acade6
@ -3,6 +3,12 @@ api.dmsf_file do
|
||||
api.name @file.name
|
||||
api.project_id @file.project_id
|
||||
api.dmsf_folder_id @file.dmsf_folder_id if @file.dmsf_folder_id
|
||||
api.version "#{@file.last_revision.major_version}.#{@file.last_revision.minor_version}" if @file.last_revision
|
||||
if @file.last_revision
|
||||
api.version "#{@file.last_revision.major_version}.#{@file.last_revision.minor_version}"
|
||||
api.mime_type @file.last_revision.mime_type
|
||||
api.digest @file.last_revision.digest
|
||||
api.size @file.last_revision.size
|
||||
api.description @file.last_revision.description
|
||||
end
|
||||
api.content_url url_for(:controller => :dmsf_files, :action => 'show', :download => '', :id => @file)
|
||||
end
|
||||
3
test/fixtures/dmsf_file_revisions.yml
vendored
3
test/fixtures/dmsf_file_revisions.yml
vendored
@ -8,7 +8,7 @@ dmsf_file_revisions_001:
|
||||
size: 4
|
||||
mime_type: text/plain
|
||||
title: "Test File"
|
||||
description: NULL
|
||||
description: 'Some file :-)'
|
||||
workflow: NULL
|
||||
minor_version: 0
|
||||
major_version: 1
|
||||
@ -18,6 +18,7 @@ dmsf_file_revisions_001:
|
||||
user_id: 1
|
||||
dmsf_workflow_assigned_by: 1
|
||||
dmsf_workflow_started_by: 1
|
||||
digest: '81dc9bdb52d04dc20036dbd8313ed055'
|
||||
created_at: 2017-04-18 14:52:27 +02:00
|
||||
|
||||
#revision for file on non-enabled project
|
||||
|
||||
@ -66,12 +66,20 @@ class DmsfFileApiTest < RedmineDmsf::Test::IntegrationTest
|
||||
# <name>test.txt</name>
|
||||
# <project_id>1</project_id>
|
||||
# <version>1.0</version>
|
||||
# <mime_type>text/plain</mime_type>
|
||||
# <digest>81dc9bdb52d04dc20036dbd8313ed055</digest>
|
||||
# <size>4</size>
|
||||
# <description>Some file :-)</description>
|
||||
# <content_url>/dmsf/files/1/download</content_url>
|
||||
# </dmsf_file>
|
||||
assert_select 'dmsf_file > id', :text => @file1.id.to_s
|
||||
assert_select 'dmsf_file > name', :text => @file1.name
|
||||
assert_select 'dmsf_file > project_id', :text => @file1.project_id.to_s
|
||||
assert_select 'dmsf_file > version', :text => "#{@file1.last_revision.major_version}.#{@file1.last_revision.minor_version}"
|
||||
assert_select 'dmsf_file > mime_type', :text => @file1.last_revision.mime_type
|
||||
assert_select 'dmsf_file > digest', :text => @file1.last_revision.digest
|
||||
assert_select 'dmsf_file > size', :text => @file1.last_revision.size.to_s
|
||||
assert_select 'dmsf_file > description', :text => @file1.last_revision.description
|
||||
assert_select 'dmsf_file > content_url', :text => "/dmsf/files/#{@file1.id}/download"
|
||||
#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?key=#{token.value}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user