Arpit Jalan
2018-10-19 20:28:35 +05:30
parent dca830cb73
commit ce0a51665e
3 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,7 @@ describe MaxEmojisValidator do
shared_examples "validating any topic title" do
it 'adds an error when emoji count is greater than SiteSetting.max_emojis_in_title' do
SiteSetting.max_emojis_in_title = 3
record.title = '🧐 Lots of emojis here 🎃 :joy: :sunglasses:'
record.title = '🧐 Lots of emojis here 🎃 :joy: :)'
validate
expect(record.errors[:title][0]).to eq(I18n.t("errors.messages.max_emojis", max_emojis_count: 3))