FIX: Replying to deleted post via email should create new reply to topic

This commit is contained in:
Gerhard Schlager
2018-09-03 23:06:25 +02:00
parent fe6c3b7d2e
commit eeedc3901e
2 changed files with 13 additions and 4 deletions

View File

@@ -351,6 +351,12 @@ describe Email::Receiver do
expect { process(:staged_reply_restricted) }.to change { topic.posts.count }
end
it "posts a reply to the topic when the post was deleted" do
post.update_columns(deleted_at: 1.day.ago)
expect { process(:reply_user_matching) }.to change { topic.posts.count }
expect(topic.ordered_posts.last.reply_to_post_number).to be_nil
end
describe 'Unsubscribing via email' do
let(:last_email) { ActionMailer::Base.deliveries.last }