mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Use subfolder-safe url for category in html view (#24595)
Use subfolder-safe url for category in html view
This commit is contained in:
@@ -4,7 +4,22 @@ require "rails_helper"
|
||||
require "ostruct"
|
||||
|
||||
RSpec.describe "topics/show.html.erb" do
|
||||
fab!(:topic)
|
||||
fab!(:category)
|
||||
fab!(:topic) { Fabricate(:topic, category: category) }
|
||||
|
||||
it "uses subfolder-safe category url" do
|
||||
set_subfolder "/subpath"
|
||||
topic_view = OpenStruct.new(topic: topic, posts: [])
|
||||
topic_view.stubs(:summary).returns("")
|
||||
view.stubs(:crawler_layout?).returns(false)
|
||||
assign(:topic_view, topic_view)
|
||||
assign(:breadcrumbs, [{ name: category.name, color: category.color }])
|
||||
assign(:tags, [])
|
||||
|
||||
render template: "topics/show", formats: [:html]
|
||||
|
||||
assert_select "a[href='/subpath/c/#{category.slug}/#{category.id}']"
|
||||
end
|
||||
|
||||
it "add nofollow to RSS alternate link for topic" do
|
||||
topic_view = OpenStruct.new(topic: topic, posts: [])
|
||||
|
||||
Reference in New Issue
Block a user