docbrown/spec/initializers/carrierwave_monkeypatch_spec.rb
Michael Kohl 6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00

18 lines
675 B
Ruby

# rubocop:disable RSpec/FilePath
require "rails_helper"
describe CarrierWave::Storage::Fog::File do
it "replaces ApplicationConfig APP_DOMAIN with Settings::General.app_domain" do
CarrierWave::Uploader::Base.fog_credentials = {
provider: "AWS", aws_access_key_id: "foo", aws_secret_access_key: "bar"
}
allow(ApplicationConfig).to receive(:[]).with("APP_DOMAIN").and_return("s3.amazonaws.com")
allow(Settings::General).to receive(:app_domain).and_return("forem.com")
file_url = described_class.new(
CarrierWave::Uploader::Base, nil, "/a/path"
).url
expect(file_url).to include("forem.com")
end
end
# rubocop:enable RSpec/FilePath