mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 13:35:20 -05:00
FIX: quoted private topic url respects subfolder install (#25643)
Fixes an issue where private topics that are quoted have an incorrectly formatted url when using a subfolder install. This update returns a relative url that includes the base_path rather than a combination of base_url + base_path.
This commit is contained in:
@@ -311,6 +311,24 @@ RSpec.describe Topic do
|
||||
end
|
||||
end
|
||||
|
||||
describe "slugless_url" do
|
||||
fab!(:topic)
|
||||
|
||||
it "returns the correct url" do
|
||||
expect(topic.slugless_url).to eq("/t/#{topic.id}")
|
||||
end
|
||||
|
||||
it "works with post id" do
|
||||
expect(topic.slugless_url(123)).to eq("/t/#{topic.id}/123")
|
||||
end
|
||||
|
||||
it "works with subfolder install" do
|
||||
set_subfolder "/forum"
|
||||
|
||||
expect(topic.slugless_url).to eq("/forum/t/#{topic.id}")
|
||||
end
|
||||
end
|
||||
|
||||
describe "updating a title to be shorter" do
|
||||
let!(:topic) { Fabricate(:topic) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user