gitlab-org--gitlab-foss/spec/lib/gitlab/award_emoji_spec.rb

27 lines
733 B
Ruby
Raw Normal View History

require 'spec_helper'
2016-04-16 15:09:08 -04:00
describe Gitlab::AwardEmoji do
describe '.urls' do
2016-04-16 15:09:08 -04:00
subject { Gitlab::AwardEmoji.urls }
it { is_expected.to be_an_instance_of(Array) }
it { is_expected.not_to be_empty }
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
2016-04-14 12:38:17 -04:00
describe '.emoji_by_category' do
it "only contains known categories" do
2016-04-16 15:09:08 -04:00
undefined_categories = Gitlab::AwardEmoji.emoji_by_category.keys - Gitlab::AwardEmoji::CATEGORIES.keys
2016-04-14 12:38:17 -04:00
expect(undefined_categories).to be_empty
end
end
end