mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Apply syntax_tree formatting to spec/*
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'global_path'
|
||||
require "global_path"
|
||||
|
||||
class GlobalPathInstance
|
||||
extend GlobalPath
|
||||
end
|
||||
|
||||
RSpec.describe GlobalPath do
|
||||
describe '.cdn_relative_path' do
|
||||
describe ".cdn_relative_path" do
|
||||
def cdn_relative_path(p)
|
||||
GlobalPathInstance.cdn_relative_path(p)
|
||||
end
|
||||
@ -27,16 +27,19 @@ RSpec.describe GlobalPath do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.upload_cdn_path' do
|
||||
it 'generates correctly when S3 bucket has a folder' do
|
||||
global_setting :s3_access_key_id, 's3_access_key_id'
|
||||
global_setting :s3_secret_access_key, 's3_secret_access_key'
|
||||
global_setting :s3_bucket, 'file-uploads/folder'
|
||||
global_setting :s3_region, 'us-west-2'
|
||||
global_setting :s3_cdn_url, 'https://cdn-aws.com/folder'
|
||||
describe ".upload_cdn_path" do
|
||||
it "generates correctly when S3 bucket has a folder" do
|
||||
global_setting :s3_access_key_id, "s3_access_key_id"
|
||||
global_setting :s3_secret_access_key, "s3_secret_access_key"
|
||||
global_setting :s3_bucket, "file-uploads/folder"
|
||||
global_setting :s3_region, "us-west-2"
|
||||
global_setting :s3_cdn_url, "https://cdn-aws.com/folder"
|
||||
|
||||
expect(GlobalPathInstance.upload_cdn_path("#{Discourse.store.absolute_base_url}/folder/upload.jpg"))
|
||||
.to eq("https://cdn-aws.com/folder/upload.jpg")
|
||||
expect(
|
||||
GlobalPathInstance.upload_cdn_path(
|
||||
"#{Discourse.store.absolute_base_url}/folder/upload.jpg",
|
||||
),
|
||||
).to eq("https://cdn-aws.com/folder/upload.jpg")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user