mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: discobot fails when max_emojis_in_title=0 (#5710)
* If discobot is enabled but max_emojis_in_title==0, try to strip emoji from the title when creating a new post
This commit is contained in:

committed by
Régis Hanol

parent
0187423c68
commit
ed4d7ae1b9
@ -32,6 +32,21 @@ describe User do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with title emoji disabled' do
|
||||
before do
|
||||
SiteSetting.disable_discourse_narrative_bot_welcome_post = false
|
||||
SiteSetting.max_emojis_in_title = 0
|
||||
end
|
||||
|
||||
it 'initiates the bot' do
|
||||
expect { user }.to change { Topic.count }.by(1)
|
||||
|
||||
expect(Topic.last.title).to eq(I18n.t(
|
||||
'discourse_narrative_bot.new_user_narrative.hello.title'
|
||||
).gsub(/:robot:/, '').strip)
|
||||
end
|
||||
end
|
||||
|
||||
context 'enabled' do
|
||||
before do
|
||||
SiteSetting.disable_discourse_narrative_bot_welcome_post = false
|
||||
|
Reference in New Issue
Block a user