Move custom page 404 test to controller specs

So it's similar to the other custom page 404 tests.

Note we're explicitely marking the page as a draft so it's more obvious
what's going on in the test.
This commit is contained in:
Javi Martín
2021-03-26 19:06:24 +01:00
parent 489e012e1b
commit 81295abd8c
2 changed files with 8 additions and 15 deletions

View File

@@ -45,5 +45,13 @@ describe PagesController do
get :show, params: { id: "nonExistentJavaScript.js" }
expect(response).to be_not_found
end
it "returns a 404 message for draft pages" do
create(:site_customization_page, slug: "other-slug", status: "draft")
get :show, params: { id: "other-slug" }
expect(response).to be_not_found
end
end
end