Commit fd177184 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Removed unused methods from Gitlab::Emoji

parent 710bfde3
......@@ -4,10 +4,6 @@ module Gitlab
module Emoji
extend self
def emojis
TanukiEmoji.index.instance_variable_get(:@name_index)
end
def emojis_by_moji
TanukiEmoji.index.instance_variable_get(:@codepoints_index)
end
......@@ -16,10 +12,6 @@ module Gitlab
emojis_by_moji.keys
end
def emojis_names
emojis.keys
end
def emojis_aliases
@emoji_aliases ||= Gitlab::Json.parse(File.read(Rails.root.join('fixtures', 'emojis', 'aliases.json')))
end
......
......@@ -3,43 +3,10 @@
require 'spec_helper'
RSpec.describe Gitlab::Emoji do
let_it_be(:emojis) { TanukiEmoji.index.all.index_by(&:name) }
let_it_be(:emojis_by_moji) { TanukiEmoji.index.all.index_by(&:codepoints) }
let_it_be(:emoji_unicode_versions_by_name) { Gitlab::Json.parse(File.read(Rails.root.join('fixtures', 'emojis', 'emoji-unicode-version-map.json'))) }
let_it_be(:emojis_aliases) { Gitlab::Json.parse(File.read(Rails.root.join('fixtures', 'emojis', 'aliases.json'))) }
describe '.emojis' do
it 'returns emojis' do
current_emojis = described_class.emojis.values
expect(current_emojis).to match_array(emojis)
end
end
describe '.emojis_by_moji' do
it 'return emojis by moji' do
current_emojis_by_moji = described_class.emojis_by_moji
expect(current_emojis_by_moji).to eq(emojis_by_moji)
end
end
describe '.emojis_unicodes' do
it 'returns emoji unicodes' do
emoji_keys = described_class.emojis_unicodes
expect(emoji_keys).to eq(emojis_by_moji.keys)
end
end
describe '.emojis_names' do
it 'returns emoji names' do
emoji_names = described_class.emojis_names
expect(emoji_names).to eq(emojis.keys)
end
end
describe '.emojis_aliases' do
it 'returns emoji aliases' do
emoji_aliases = described_class.emojis_aliases
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment