mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: categories page crawler view had incorrect URLs
This commit is contained in:
parent
568276fe40
commit
f4b5eccad3
@ -3,9 +3,9 @@
|
||||
<% @category_list.categories.each_with_index do |c, index| %>
|
||||
<div class='category' itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||
<meta itemprop='position' content='<%= index %>'>
|
||||
<meta itemprop='url' content='<%= "#{Discourse.base_url}#{c.url}" %>'>
|
||||
<meta itemprop='url' content='<%= "#{c.url}" %>'>
|
||||
<h2>
|
||||
<a href='<%= "#{Discourse.base_url}#{c.url}" %>' itemprop='item'>
|
||||
<a href='<%= "#{c.url}" %>' itemprop='item'>
|
||||
<span itemprop='name'><%= c.name %></span>
|
||||
</a>
|
||||
</h2>
|
||||
|
@ -17,6 +17,15 @@ describe CategoriesController do
|
||||
get "/categories"
|
||||
expect(response.body).not_to include('AMAZING AMAZING')
|
||||
end
|
||||
|
||||
it 'web crawler view has correct urls for subfolder install' do
|
||||
GlobalSetting.stubs(:relative_url_root).returns('/forum')
|
||||
Discourse.stubs(:base_uri).returns("/forum")
|
||||
get '/categories', headers: { 'HTTP_USER_AGENT' => 'Googlebot' }
|
||||
html = Nokogiri::HTML(response.body)
|
||||
expect(html.css('body.crawler')).to be_present
|
||||
expect(html.css("a[href=\"/forum/c/#{category.slug}\"]")).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
context 'extensibility event' do
|
||||
|
Loading…
Reference in New Issue
Block a user