FIX: show category name in title for crawler view
Show category name in title for crawler view despite presence of `short_site_description`. Bug reported here: https://meta.discourse.org/t/short-site-description-break-category-title-for-crawler-or-its-the-expected-behavior/122109/
This commit is contained in:
@@ -463,6 +463,23 @@ RSpec.describe ListController do
|
||||
expect(css_select("link[rel=canonical]").length).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "renders correct title" do
|
||||
let!(:amazing_category) { Fabricate(:category, name: "Amazing Category") }
|
||||
|
||||
it 'for category default view' do
|
||||
get "/c/#{amazing_category.slug}"
|
||||
|
||||
expect(response.body).to have_tag "title", text: "Amazing Category - Discourse"
|
||||
end
|
||||
|
||||
it 'for category latest view' do
|
||||
SiteSetting.short_site_description = "Best community"
|
||||
get "/c/#{amazing_category.slug}/l/latest"
|
||||
|
||||
expect(response.body).to have_tag "title", text: "Amazing Category - Discourse"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user