Commit f9c6ad70 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Apply review suggestions

parent 64ac6674
...@@ -12,7 +12,7 @@ class AwardEmoji < ApplicationRecord ...@@ -12,7 +12,7 @@ class AwardEmoji < ApplicationRecord
belongs_to :user belongs_to :user
validates :user, presence: true validates :user, presence: true
validates :awardable, presence: true, unless: [:importing?] validates :awardable, presence: true, unless: :importing?
validates :name, presence: true, inclusion: { in: Gitlab::Emoji.emojis_names } validates :name, presence: true, inclusion: { in: Gitlab::Emoji.emojis_names }
validates :name, uniqueness: { scope: [:user, :awardable_type, :awardable_id] }, unless: :ghost_user? validates :name, uniqueness: { scope: [:user, :awardable_type, :awardable_id] }, unless: :ghost_user?
......
...@@ -217,8 +217,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -217,8 +217,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it 'has award emoji for a snippet' do it 'has award emoji for a snippet' do
award_emoji = @project.snippets.first.award_emoji award_emoji = @project.snippets.first.award_emoji
expect(award_emoji.count).to eq(2) expect(award_emoji.map(&:name)).to contain_exactly('thumbsup', 'coffee')
expect(award_emoji.map(&:name)).to match_array(%w[thumbsup coffee])
end end
it 'restores the correct service' do it 'restores the correct service' do
......
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