FEATURE: default emoji override

This commit is contained in:
Régis Hanol 2014-12-25 17:58:15 +01:00
parent 92d61755b3
commit 9932bea7ce
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@ class Admin::EmojisController < Admin::AdminController
.downcase
# check the name doesn't already exist
if Emoji.all.detect { |e| e.name == name }
if Emoji.custom.detect { |e| e.name == name }
render json: failed_json.merge(message: I18n.t("emoji.errors.name_already_exists", name: name)), status: 422
else
if emoji = Emoji.create_for(file, name)

View file

@ -29,7 +29,7 @@ describe Admin::EmojisController do
context '.create' do
before { Emoji.expects(:all).returns([custom_emoji]) }
before { Emoji.expects(:custom).returns([custom_emoji]) }
context 'name already exist' do
it "throws an error" do