mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:17:48 +08:00
FIX: don't error topic RSS when posts are deleted (#11641)
This commit is contained in:
parent
1cf9231045
commit
4928f9cceb
|
@ -840,6 +840,8 @@ class TopicsController < ApplicationController
|
|||
end
|
||||
|
||||
def feed
|
||||
raise Discourse::NotFound if !Post.exists?(topic_id: params[:topic_id])
|
||||
|
||||
@topic_view = TopicView.new(params[:topic_id])
|
||||
discourse_expires_in 1.minute
|
||||
render 'topics/show', formats: [:rss]
|
||||
|
|
|
@ -2519,6 +2519,12 @@ RSpec.describe TopicsController do
|
|||
expect(response.body).to_not include("/forum/forum")
|
||||
expect(response.body).to include("http://test.localhost/forum/t/#{topic.slug}")
|
||||
end
|
||||
|
||||
it 'returns 404 when posts are deleted' do
|
||||
topic.posts.each(&:trash!)
|
||||
get "/t/foo/#{topic.id}.rss"
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#invite_group' do
|
||||
|
|
Loading…
Reference in New Issue
Block a user