mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
FIX: Invalid setex expire time in DiscourseNarrativeBot::Actions#reset_rate_limits
.
This commit is contained in:
@ -211,6 +211,22 @@ describe DiscourseNarrativeBot::NewUserNarrative do
|
||||
expect(narrative.get_data(user)[:state].to_sym).to eq(:tutorial_bookmark)
|
||||
end
|
||||
|
||||
describe 'when rate_limit_new_user_create_post site setting is disabled' do
|
||||
before do
|
||||
SiteSetting.rate_limit_new_user_create_post = 0
|
||||
end
|
||||
|
||||
it 'should create the right reply' do
|
||||
narrative.input(:reply, user, post: post)
|
||||
new_post = Post.last
|
||||
|
||||
expect(new_post.raw).to eq(I18n.t(
|
||||
'discourse_narrative_bot.new_user_narrative.bookmark.not_found',
|
||||
base_uri: ''
|
||||
))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when reply contains the skip trigger' do
|
||||
it 'should create the right reply' do
|
||||
post.update!(raw: "@#{discobot_user.username} #{skip_trigger.upcase}")
|
||||
|
Reference in New Issue
Block a user