FIX: Don't allow people to clear the upload bucket while it's enabled

This commit is contained in:
Robin Ward
2020-03-05 16:04:31 -05:00
parent d1cceff0e7
commit 4bb8db024c
2 changed files with 11 additions and 0 deletions

View File

@ -103,6 +103,15 @@ describe SiteSettings::Validations do
SiteSetting.s3_backup_bucket = "my-awesome-bucket/foo"
expect { validate("my-awesome-bucket/foo/uploads") }.to raise_error(Discourse::InvalidParameters, error_message)
end
it "cannot be made blank unless the setting is false" do
SiteSetting.s3_backup_bucket = "really-real-cool-bucket"
SiteSetting.enable_s3_uploads = true
expect { validate("") }.to raise_error(Discourse::InvalidParameters)
SiteSetting.enable_s3_uploads = false
validate("")
end
end
end