FIX: SiteSetting.title was being polluted in StaticController (#15385)

Regressed in #15324
This commit is contained in:
Jarek Radosz 2021-12-21 20:51:18 +01:00 committed by GitHub
parent 96982ca2bc
commit 72ad5bf8bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class StaticController < ApplicationController
return
end
@title = SiteSetting.title
@title = SiteSetting.title.dup
if SiteSetting.short_site_description.present?
@title << " - #{SiteSetting.short_site_description}"

View File

@ -323,6 +323,16 @@ describe StaticController do
expect(response.body).to include("Polish FAQ")
end
end
it "does not pollute SiteSetting.title (regression)" do
SiteSetting.title = "test"
SiteSetting.short_site_description = "something"
expect do
get "/login"
get "/login"
end.to_not change { SiteSetting.title }
end
end
describe '#enter' do