unit tests fix

This commit is contained in:
karel.picman@lbcfree.net 2020-08-17 10:39:44 +02:00
parent dfa474023d
commit ede0e4fcc8
2 changed files with 9 additions and 1 deletions

View File

@ -525,7 +525,14 @@ module RedmineDmsf
# Token based unlock (authenticated) will ensure that a correct token is sent, further ensuring # Token based unlock (authenticated) will ensure that a correct token is sent, further ensuring
# ownership of token before permitting unlock # ownership of token before permitting unlock
def unlock(token) def unlock(token)
return NotFound unless exist? unless exist?
puts ">>> exists? => false"
puts ">>> #{subproject&.name}"
puts ">>> #{folder&.title}"
puts ">>> #{file&.name}"
puts ">>> #{project&.name}"
return NotFound
end
if token.nil? || token.empty? || (token == '<(null)>') || User.current.anonymous? if token.nil? || token.empty? || (token == '<(null)>') || User.current.anonymous?
BadRequest BadRequest
else else

View File

@ -123,6 +123,7 @@ class DmsfWebdavUnlockTest < RedmineDmsf::Test::IntegrationTest
def test_unlock_folder def test_unlock_folder
log_user 'jsmith', 'jsmith' log_user 'jsmith', 'jsmith'
l = @folder2.locks.first l = @folder2.locks.first
puts ">>> process unlock"
process :unlock, "/dmsf/webdav/#{@folder2.project.identifier}/#{@folder2.dmsf_folder.title}/#{@folder2.title}", process :unlock, "/dmsf/webdav/#{@folder2.project.identifier}/#{@folder2.dmsf_folder.title}/#{@folder2.title}",
params: nil, params: nil,
headers: @jsmith.merge!({ HTTP_DEPTH: 'infinity', HTTP_TIMEOUT: 'Infinite', HTTP_LOCK_TOKEN: l.uuid }) headers: @jsmith.merge!({ HTTP_DEPTH: 'infinity', HTTP_TIMEOUT: 'Infinite', HTTP_LOCK_TOKEN: l.uuid })