2021-12-11 22:18:48 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
RSpec.describe AwardEmojis::BaseService, feature_category: :team_planning do
|
2021-12-11 22:18:48 +05:30
|
|
|
let(:awardable) { build(:note) }
|
|
|
|
let(:current_user) { build(:user) }
|
|
|
|
|
|
|
|
describe '.initialize' do
|
|
|
|
subject { described_class }
|
|
|
|
|
|
|
|
it 'uses same emoji name if not an alias' do
|
|
|
|
emoji_name = 'horse'
|
|
|
|
|
|
|
|
expect(subject.new(awardable, emoji_name, current_user).name).to eq(emoji_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'uses emoji original name if its an alias' do
|
|
|
|
emoji_alias = 'small_airplane'
|
|
|
|
emoji_name = 'airplane_small'
|
|
|
|
|
|
|
|
expect(subject.new(awardable, emoji_alias, current_user).name).to eq(emoji_name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|