2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-09-19 09:40:00 -05:00
|
|
|
RSpec.describe Jobs::PostUploadsRecovery do
|
2023-01-09 05:18:21 -06:00
|
|
|
describe "#grace_period" do
|
|
|
|
it "should restrict the grace period to the right range" do
|
|
|
|
SiteSetting.purge_deleted_uploads_grace_period_days = described_class::MIN_PERIOD - 1
|
2018-09-13 03:08:15 -05:00
|
|
|
|
|
|
|
expect(described_class.new.grace_period).to eq(30)
|
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
SiteSetting.purge_deleted_uploads_grace_period_days = described_class::MAX_PERIOD + 1
|
2018-09-13 03:08:15 -05:00
|
|
|
|
|
|
|
expect(described_class.new.grace_period).to eq(120)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|