FIX: Show 404 html on /posts/:id/raw and /p/:id (#16131)

It returned a blank page before.
This commit is contained in:
Jarek Radosz
2022-03-08 17:42:07 +01:00
committed by GitHub
parent 768c80c2a4
commit 14109ea92c
2 changed files with 25 additions and 11 deletions

View File

@ -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