BigW Consortium Gitlab

award_emoji_spec.rb 733 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe Gitlab::AwardEmoji do
4
  describe '.urls' do
5
    subject { Gitlab::AwardEmoji.urls }
6 7

    it { is_expected.to be_an_instance_of(Array) }
8
    it { is_expected.not_to be_empty }
9 10 11 12 13 14 15 16 17 18

    context 'every Hash in the Array' do
      it 'has the correct keys and values' do
        subject.each do |hash|
          expect(hash[:name]).to be_an_instance_of(String)
          expect(hash[:path]).to be_an_instance_of(String)
        end
      end
    end
  end
Valery Sizov committed
19 20 21

  describe '.emoji_by_category' do
    it "only contains known categories" do
22
      undefined_categories = Gitlab::AwardEmoji.emoji_by_category.keys - Gitlab::AwardEmoji::CATEGORIES.keys
Valery Sizov committed
23 24 25
      expect(undefined_categories).to be_empty
    end
  end
26
end