FIX: Post moved small action links should respect subfolder installs (#24336)

This change fixes an issue with small action links (when post is moved) to add the subfolder path to the url.
This commit is contained in:
David Battersby
2023-11-13 11:06:25 +08:00
committed by GitHub
parent 1e1bb45b96
commit 4b78254065
4 changed files with 37 additions and 1 deletions

View File

@ -2135,6 +2135,17 @@ RSpec.describe Post do
end
end
describe "relative_url" do
it "returns the correct post url with subfolder install" do
set_subfolder "/forum"
post = Fabricate(:post)
expect(post.relative_url).to eq(
"/forum/t/#{post.topic.slug}/#{post.topic.id}/#{post.post_number}",
)
end
end
describe "public_posts_count_per_day" do
before do
freeze_time DateTime.parse("2017-03-01 12:00")