mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Don't start discobot poll tutorial if polls are disabled.
https://meta.discourse.org/t/discobot-dont-take-users-through-the-poll-tutorial-if-its-not-enabled/76604/3
This commit is contained in:
@ -542,6 +542,29 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
expect(narrative.get_data(user)[:state].to_sym).to eq(:tutorial_poll)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when poll is disabled' do
|
||||
before do
|
||||
SiteSetting.poll_enabled = false
|
||||
end
|
||||
|
||||
it 'should create the right reply' do
|
||||
TopicUser.change(
|
||||
user.id,
|
||||
topic.id,
|
||||
notification_level: TopicUser.notification_levels[:tracking]
|
||||
)
|
||||
|
||||
expected_raw = <<~RAW
|
||||
#{I18n.t('discourse_narrative_bot.advanced_user_narrative.change_topic_notification_level.reply', base_uri: '')}
|
||||
|
||||
#{I18n.t('discourse_narrative_bot.advanced_user_narrative.details.instructions', base_uri: '')}
|
||||
RAW
|
||||
|
||||
expect(Post.last.raw).to eq(expected_raw.chomp)
|
||||
expect(narrative.get_data(user)[:state].to_sym).to eq(:tutorial_details)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'poll tutorial' do
|
||||
|
Reference in New Issue
Block a user