FIX: Allow advanced tutorial when title emojis are disabled
We already skip validations for other uses of PostCreator in the narrative bot, so this commit adds it in the `reply_to` action as well
This commit is contained in:
parent
555711ccb5
commit
bbb814e58e
|
@ -18,7 +18,8 @@ module DiscourseNarrativeBot
|
||||||
raw: raw,
|
raw: raw,
|
||||||
topic_id: post.topic_id,
|
topic_id: post.topic_id,
|
||||||
reply_to_post_number: post.post_number,
|
reply_to_post_number: post.post_number,
|
||||||
post_alert_options: defaut_post_alert_opts
|
post_alert_options: defaut_post_alert_opts,
|
||||||
|
skip_validations: true
|
||||||
}
|
}
|
||||||
|
|
||||||
new_post = PostCreator.create!(self.discobot_user, default_opts.merge(opts))
|
new_post = PostCreator.create!(self.discobot_user, default_opts.merge(opts))
|
||||||
|
|
|
@ -125,6 +125,15 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||||
expect(new_post.raw).to eq(expected_raw.chomp)
|
expect(new_post.raw).to eq(expected_raw.chomp)
|
||||||
expect(new_post.topic.id).to_not eq(topic.id)
|
expect(new_post.topic.id).to_not eq(topic.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not explode if title emojis are disabled' do
|
||||||
|
SiteSetting.max_emojis_in_title = 0
|
||||||
|
narrative.reset_bot(user, other_post)
|
||||||
|
|
||||||
|
expect(Topic.last.title).to eq(I18n.t('discourse_narrative_bot.advanced_user_narrative.title'))
|
||||||
|
expect(new_post.topic.id).to_not eq(topic.id)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue