A platform for community discussion. Free, open, simple.
FIX: title was repeating on about page
Arpit Jalan654d7996aef6
diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erbindex e27fb7e9836..34d034c2bac 100644--- a/app/views/about/index.html.erb+++ b/app/views/about/index.html.erb@@ -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} %>diff --git a/spec/requests/about_controller_spec.rb b/spec/requests/about_controller_spec.rbindex cf7ab39d5eb..541333c4614 100644--- a/spec/requests/about_controller_spec.rb+++ b/spec/requests/about_controller_spec.rb@@ -9,6 +9,7 @@ describe AboutController doget "/about"expect(response.status).to eq(200)+ expect(response.body).to include("<title>About - Discourse</title>")endit 'should redirect to login page for anonymous user when login_required is true' do@@ -25,5 +26,13 @@ describe AboutController doexpect(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+ endendenddiff --git a/spec/requests/static_controller_spec.rb b/spec/requests/static_controller_spec.rbindex df12d0d6d2b..37a0f4ce6d0 100644--- a/spec/requests/static_controller_spec.rb+++ b/spec/requests/static_controller_spec.rb@@ -101,6 +101,7 @@ describe StaticController doexpect(response.status).to eq(200)expect(response.body).to include(I18n.t('js.faq'))+ expect(response.body).to include("<title>FAQ - Discourse</title>")endend@@ -186,6 +187,14 @@ describe StaticController doendendend++ 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+ endenddescribe '#enter' do