feat: allow the contact page to be overridden by pages (#10924)
This commit is contained in:
parent
a715c7fe52
commit
f87ff8e2ae
2 changed files with 13 additions and 0 deletions
|
|
@ -40,6 +40,12 @@ class PagesController < ApplicationController
|
|||
set_surrogate_key_header "community_moderation_page"
|
||||
end
|
||||
|
||||
def contact
|
||||
@page = Page.find_by(slug: "contact")
|
||||
render :show if @page
|
||||
set_surrogate_key_header "contact"
|
||||
end
|
||||
|
||||
def faq
|
||||
@page = Page.find_by(slug: "faq")
|
||||
render :show if @page
|
||||
|
|
|
|||
|
|
@ -118,6 +118,13 @@ RSpec.describe "Pages", type: :request do
|
|||
end
|
||||
end
|
||||
|
||||
describe "GET /contact" do
|
||||
it "has proper headline" do
|
||||
get "/contact"
|
||||
expect(response.body).to include("Contact")
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /welcome" do
|
||||
let(:user) { create(:user, id: 1) }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue