From cbbb2cf3d11f13f9e834a9c978cd831e88e505a0 Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Mon, 16 Dec 2024 17:39:45 -0500 Subject: [PATCH] Rename file_size to dir_size --- apps/dashboard/test/models/files_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/test/models/files_test.rb b/apps/dashboard/test/models/files_test.rb index 29ff44227..b38dca802 100644 --- a/apps/dashboard/test/models/files_test.rb +++ b/apps/dashboard/test/models/files_test.rb @@ -67,11 +67,11 @@ class FilesTest < ActiveSupport::TestCase test "can_download_as_zip handles directory size within limit" do download_directory_size_limit = Configuration.file_download_dir_max Dir.mktmpdir do |dir| - file_size = download_directory_size_limit + dir_size = download_directory_size_limit PosixFile.any_instance.stubs(:calculate_directory_size) .returns(download_directory_size_limit) - Open3.stubs(:capture3).returns(["#{file_size} #{dir} - \n #{file_size} total", "", exit_success]) + Open3.stubs(:capture3).returns(["#{dir_size} #{dir} + \n #{dir_size} total", "", exit_success]) assert_equal [true, nil], PosixFile.new(dir).can_download_as_zip? end @@ -80,11 +80,11 @@ class FilesTest < ActiveSupport::TestCase test "can_download_as_zip handles directory size exceeding limit" do download_directory_size_limit = Configuration.file_download_dir_max Dir.mktmpdir do |dir| - file_size = download_directory_size_limit + 1 + dir_size = download_directory_size_limit + 1 PosixFile.any_instance.stubs(:calculate_directory_size) .returns(download_directory_size_limit + 1) - Open3.stubs(:capture3).returns(["#{file_size} #{dir} - \n #{file_size} total", "", exit_success]) + Open3.stubs(:capture3).returns(["#{dir_size} #{dir} + \n #{dir_size} total", "", exit_success]) result = PosixFile.new(dir).can_download_as_zip? error = I18n.t('dashboard.files_directory_too_large', download_directory_size_limit: download_directory_size_limit)