mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
FIX: Show 404 html on /posts/:id/raw and /p/:id (#16131)
It returned a blank page before.
This commit is contained in:
@ -1931,6 +1931,12 @@ describe PostsController do
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to eq("123456789")
|
||||
end
|
||||
|
||||
it "renders a 404 page" do
|
||||
get "/posts/0/raw"
|
||||
expect(response.status).to eq(404)
|
||||
expect(response.body).to include(I18n.t("page_not_found.title"))
|
||||
end
|
||||
end
|
||||
|
||||
describe '#markdown_num' do
|
||||
@ -1968,6 +1974,12 @@ describe PostsController do
|
||||
get "/p/#{post.id}.json"
|
||||
expect(response).to be_forbidden
|
||||
end
|
||||
|
||||
it "renders a 404 page" do
|
||||
get "/p/0"
|
||||
expect(response.status).to eq(404)
|
||||
expect(response.body).to include(I18n.t("page_not_found.title"))
|
||||
end
|
||||
end
|
||||
|
||||
describe '#user_posts_feed' do
|
||||
|
Reference in New Issue
Block a user