FIX: title was repeating on about page

This commit is contained in:
Arpit Jalan 2018-11-28 08:06:14 +05:30
parent c275027939
commit 654d7996ae
3 changed files with 18 additions and 2 deletions

View File

@ -1,7 +1,5 @@
<% if crawler_layout? %>
<% content_for :title do %><%=t "about" %> - <%= SiteSetting.title %><% end %>
<section itemscope itemtype="https://schema.org/AboutPage">
<h1 itemprop="name">
<%=t "js.about.title", {title: @about.title} %>

View File

@ -9,6 +9,7 @@ describe AboutController do
get "/about"
expect(response.status).to eq(200)
expect(response.body).to include("<title>About - Discourse</title>")
end
it 'should redirect to login page for anonymous user when login_required is true' do
@ -25,5 +26,13 @@ describe AboutController do
expect(response.status).to eq(200)
end
context "crawler view" do
it "should include correct title" do
get '/about', headers: { 'HTTP_USER_AGENT' => 'Googlebot' }
expect(response.status).to eq(200)
expect(response.body).to include("<title>About - Discourse</title>")
end
end
end
end

View File

@ -101,6 +101,7 @@ describe StaticController do
expect(response.status).to eq(200)
expect(response.body).to include(I18n.t('js.faq'))
expect(response.body).to include("<title>FAQ - Discourse</title>")
end
end
@ -186,6 +187,14 @@ describe StaticController do
end
end
end
context "crawler view" do
it "should include correct title" do
get '/faq', headers: { 'HTTP_USER_AGENT' => 'Googlebot' }
expect(response.status).to eq(200)
expect(response.body).to include("<title>FAQ - Discourse</title>")
end
end
end
describe '#enter' do