mirror of
https://github.com/discourse/discourse.git
synced 2026-03-05 15:27:34 +08:00
We currently allow assigning nil to site settings, which lead to implicit casting to other values. Forcing explicit handling of this case helps avoid accidental misconfiguration. This should not affect changing site settings from the UI, which is already well-behaved in this regard.
23 lines
637 B
Ruby
23 lines
637 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe Jobs::EnsureS3UploadsExistence do
|
|
subject(:job) { described_class.new }
|
|
|
|
context "when `s3_inventory_bucket` has been set" do
|
|
before { SiteSetting.s3_inventory_bucket = "some-bucket-name" }
|
|
|
|
it "works" do
|
|
S3Inventory.any_instance.expects(:backfill_etags_and_list_missing).once
|
|
job.execute({})
|
|
end
|
|
end
|
|
|
|
context "when `s3_inventory_bucket` has not been set" do
|
|
before { SiteSetting.s3_inventory_bucket = "" }
|
|
|
|
it "doesn't execute" do
|
|
S3Inventory.any_instance.expects(:backfill_etags_and_list_missing).never
|
|
job.execute({})
|
|
end
|
|
end
|
|
end
|