feat: allow the contact page to be overridden by pages (#10924)

This commit is contained in:
Ridhwana 2020-10-19 22:16:56 +02:00 committed by GitHub
parent a715c7fe52
commit f87ff8e2ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

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

View file

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