mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
UX: Let users know they disabled discobot and they can't interact with it. (#12534)
Discobot will reply to users they need to enable onboarding tips to interact with them when issued a command.
This commit is contained in:
@ -19,6 +19,8 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
before do
|
||||
stub_request(:get, "http://api.forismatic.com/api/1.0/?format=json&lang=en&method=getQuote").
|
||||
to_return(status: 200, body: "{\"quoteText\":\"Be Like Water\",\"quoteAuthor\":\"Bruce Lee\"}")
|
||||
|
||||
SiteSetting.discourse_narrative_bot_enabled = true
|
||||
end
|
||||
|
||||
let(:help_message) do
|
||||
@ -466,6 +468,16 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
expect(new_post.raw).to eq(random_mention_reply)
|
||||
end
|
||||
|
||||
it 'tells the user to enable the onboarding tips first' do
|
||||
user.user_option.update!(skip_new_user_tips: true)
|
||||
post.update!(raw: 'Show me what you can do @discobot')
|
||||
|
||||
described_class.new(:reply, user, post_id: post.id).select
|
||||
|
||||
new_post = Post.last
|
||||
expect(new_post.raw).to eq(I18n.t('discourse_narrative_bot.track_selector.random_mention.discobot_disabled'))
|
||||
end
|
||||
|
||||
it "should be case insensitive towards discobot's username" do
|
||||
discobot_user.update!(username: 'DisCoBot')
|
||||
|
||||
|
@ -167,4 +167,12 @@ describe User do
|
||||
expect(DiscourseNarrativeBot::Store.get(user.id)).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#manually_disabled_discobot?' do
|
||||
it 'returns true if the user manually disabled new user tips' do
|
||||
user.user_option.skip_new_user_tips = true
|
||||
|
||||
expect(user.manually_disabled_discobot?).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user