FIX: improve support for subfolder S3 CDN

This commit is contained in:
Sam
2018-08-22 12:31:13 +10:00
parent f5142861e5
commit 5d96809abd
5 changed files with 41 additions and 10 deletions

View File

@ -23,6 +23,15 @@ describe ApplicationHelper do
set_env "COMPRESS_BROTLI", "1"
end
after do
ActionController::Base.config.relative_url_root = nil
end
it "deals correctly with subfolder" do
ActionController::Base.config.relative_url_root = "/community"
expect(helper.preload_script("application")).to include('https://s3cdn.com/assets/application.js')
end
it "returns magic brotli mangling for brotli requests" do
helper.request.env["HTTP_ACCEPT_ENCODING"] = 'br'