Skip discobot mention tutorial if mentions are disabled.
This commit is contained in:
parent
f28a53db48
commit
ff0979553d
|
@ -51,6 +51,7 @@ module DiscourseNarrativeBot
|
|||
},
|
||||
|
||||
tutorial_mention: {
|
||||
prerequisite: Proc.new { SiteSetting.enable_mentions },
|
||||
next_state: :tutorial_formatting,
|
||||
next_instructions: Proc.new { I18n.t("#{I18N_KEY}.formatting.instructions", base_uri: Discourse.base_uri) },
|
||||
|
||||
|
|
|
@ -690,6 +690,23 @@ describe DiscourseNarrativeBot::NewUserNarrative do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'when user mentions is disabled' do
|
||||
before do
|
||||
SiteSetting.enable_mentions = false
|
||||
end
|
||||
|
||||
it 'should skip the mention tutorial step' do
|
||||
post.update!(
|
||||
raw: ':monkey: :fries:'
|
||||
)
|
||||
|
||||
narrative.expects(:enqueue_timeout_job).with(user)
|
||||
narrative.input(:reply, user, post: post)
|
||||
|
||||
expect(narrative.get_data(user)[:state].to_sym).to eq(:tutorial_formatting)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should create the right reply' do
|
||||
post.update!(
|
||||
raw: ':monkey: :fries:'
|
||||
|
|
Loading…
Reference in New Issue