FIX: run the rake task only for uploads created before a day from inventory date

This commit is contained in:
Vinoth Kannan
2019-02-14 17:53:08 +05:30
parent fc14847c14
commit b5fbd7385f
2 changed files with 6 additions and 6 deletions

View File

@@ -66,8 +66,8 @@ describe "S3Inventory" do
inventory.expects(:download_inventory_files_to_tmp_directory)
inventory.expects(:decompress_inventory_files)
inventory.expects(:files).returns([{ key: "Key", filename: "#{csv_filename}.gz" }]).at_least(1)
inventory.expects(:last_modified).returns(Time.now)
inventory.expects(:files).returns([{ key: "Key", filename: "#{csv_filename}.gz" }]).times(2)
inventory.expects(:inventory_date).returns(Time.now)
output = capture_stdout do
inventory.list_missing
@@ -81,7 +81,7 @@ describe "S3Inventory" do
inventory.expects(:download_inventory_files_to_tmp_directory)
inventory.expects(:decompress_inventory_files)
inventory.expects(:files).returns([{ key: "Key", filename: "#{csv_filename}.gz" }]).at_least(1)
inventory.expects(:files).returns([{ key: "Key", filename: "#{csv_filename}.gz" }]).times(2)
output = capture_stdout do
expect { inventory.list_missing(backfill_etags: true) }.to change { Upload.where(etag: nil).count }.by(-1)