mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Recover post tutorial does not work when SiteSetting.delete_removed_posts_after
is 0.
This commit is contained in:
@ -303,6 +303,30 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
)
|
||||
end
|
||||
|
||||
describe 'when posts are configured to be deleted immediately' do
|
||||
before do
|
||||
SiteSetting.delete_removed_posts_after = 0
|
||||
end
|
||||
|
||||
it 'should set up the tutorial correctly' do
|
||||
narrative.set_data(user,
|
||||
state: :tutorial_delete,
|
||||
topic_id: topic.id,
|
||||
track: described_class.to_s
|
||||
)
|
||||
|
||||
PostDestroyer.new(user, post).destroy
|
||||
|
||||
post = Post.last
|
||||
|
||||
expect(post.raw).to eq(I18n.t('js.post.deleted_by_author', count: 1))
|
||||
|
||||
PostDestroyer.destroy_stubs
|
||||
|
||||
expect(post.reload).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when user replies to the topic' do
|
||||
it 'should create the right reply' do
|
||||
narrative.set_data(user, narrative.get_data(user).merge(
|
||||
|
Reference in New Issue
Block a user