From 22510b90fda13a75d8747e4f503ea3527b0878b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Wed, 16 Oct 2024 09:39:06 +0200 Subject: [PATCH] DmsfFileNotFoundError --- app/models/dmsf_lock.rb | 4 ++-- lib/dav4rack/xml_response.rb | 4 ++-- test/unit/lib/redmine_dmsf/dmsf_zip_test.rb | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/models/dmsf_lock.rb b/app/models/dmsf_lock.rb index 31b2e13e..e1a149bc 100644 --- a/app/models/dmsf_lock.rb +++ b/app/models/dmsf_lock.rb @@ -64,7 +64,7 @@ class DmsfLock < ApplicationRecord end end - def self.find_by_param(*args) - find(*args) + def self.find_by_param(...) + find(...) end end diff --git a/lib/dav4rack/xml_response.rb b/lib/dav4rack/xml_response.rb index 0f9545da..1d01cac4 100644 --- a/lib/dav4rack/xml_response.rb +++ b/lib/dav4rack/xml_response.rb @@ -52,8 +52,8 @@ module Dav4rack end end - def render_lockdiscovery(**options) - render_xml ox_element(D_PROP, ox_element(D_LOCKDISCOVERY, activelock(**options))) + def render_lockdiscovery(...) + render_xml ox_element(D_PROP, ox_element(D_LOCKDISCOVERY, activelock(...))) end # diff --git a/test/unit/lib/redmine_dmsf/dmsf_zip_test.rb b/test/unit/lib/redmine_dmsf/dmsf_zip_test.rb index 85f0110f..1d5d8c9b 100644 --- a/test/unit/lib/redmine_dmsf/dmsf_zip_test.rb +++ b/test/unit/lib/redmine_dmsf/dmsf_zip_test.rb @@ -31,7 +31,7 @@ class DmsfZipTest < RedmineDmsf::Test::HelperTest @dmsf_file1 = DmsfFile.find(1) @dmsf_folder2 = DmsfFolder.find(2) set_fixtures_attachments_directory - @attachment4 = Attachment.find(4) + @attachment6 = Attachment.find(6) end def teardown @@ -53,12 +53,13 @@ class DmsfZipTest < RedmineDmsf::Test::HelperTest end def test_add_attachment - @zip.add_attachment @attachment4, @attachment4.filename + assert File.exist?(@attachment6.diskfile), @attachment6.diskfile + @zip.add_attachment @attachment6, @attachment6.filename assert_equal 0, @zip.dmsf_files.size zip_file = @zip.finish Zip::File.open(zip_file) do |file| file.each do |entry| - assert_equal @attachment4.filename, entry.name + assert_equal @attachment6.filename, entry.name end end end