Skip to content

Commit

Permalink
Rename file_size to dir_size
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-mgd committed Dec 16, 2024
1 parent e5c7e6a commit cbbb2cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/dashboard/test/models/files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit cbbb2cf

Please sign in to comment.