mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FEATURE: allows multiple custom emoji groups (#9308)
Note: DBHelper would fail with a sql syntax error on columns like "group". Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
@ -538,4 +538,30 @@ describe Plugin::Instance do
|
||||
expect(Reviewable.types).to match_array(current_list << new_element)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#register_emoji' do
|
||||
before do
|
||||
Plugin::CustomEmoji.clear_cache
|
||||
end
|
||||
|
||||
it 'allows to register an emoji' do
|
||||
Plugin::Instance.new.register_emoji("foo", "/foo/bar.png")
|
||||
|
||||
custom_emoji = Emoji.custom.first
|
||||
|
||||
expect(custom_emoji.name).to eq("foo")
|
||||
expect(custom_emoji.url).to eq("/foo/bar.png")
|
||||
expect(custom_emoji.group).to eq(Emoji::DEFAULT_GROUP)
|
||||
end
|
||||
|
||||
it 'allows to register an emoji with a group' do
|
||||
Plugin::Instance.new.register_emoji("bar", "/baz/bar.png", "baz")
|
||||
|
||||
custom_emoji = Emoji.custom.first
|
||||
|
||||
expect(custom_emoji.name).to eq("bar")
|
||||
expect(custom_emoji.url).to eq("/baz/bar.png")
|
||||
expect(custom_emoji.group).to eq("baz")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user