2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-09-19 10:40:00 -04:00
|
|
|
RSpec.describe Jobs::PostUploadsRecovery do
|
2018-09-13 04:08:15 -04: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
|
|
|
|
|
|
|
|
expect(described_class.new.grace_period).to eq(30)
|
|
|
|
|
|
|
|
SiteSetting.purge_deleted_uploads_grace_period_days =
|
|
|
|
described_class::MAX_PERIOD + 1
|
|
|
|
|
|
|
|
expect(described_class.new.grace_period).to eq(120)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|