mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Use CDN for custom emojis (#11401)
This commit is contained in:
23
spec/serializers/emoji_serializer_spec.rb
Normal file
23
spec/serializers/emoji_serializer_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe EmojiSerializer do
|
||||
fab!(:emoji) do
|
||||
CustomEmoji.create!(name: 'trout', upload: Fabricate(:upload))
|
||||
Emoji.load_custom.first
|
||||
end
|
||||
|
||||
subject { described_class.new(emoji, root: false) }
|
||||
|
||||
describe '#url' do
|
||||
it 'returns a valid URL' do
|
||||
expect(subject.url).to start_with('/uploads/')
|
||||
end
|
||||
|
||||
it 'works with a CDN' do
|
||||
set_cdn_url('https://cdn.com')
|
||||
expect(subject.url).to start_with('https://cdn.com')
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user