mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: update base url links to respect subfolder installs (#27740)
This change eliminates a couple of instances where subfolder urls are badly formatted, in most cases we can use Discourse.base_url_no_prefix to prevent adding the subfolder to the base url.
This commit is contained in:
@ -2238,6 +2238,17 @@ RSpec.describe Post do
|
||||
end
|
||||
end
|
||||
|
||||
describe "full_url" do
|
||||
it "returns the correct post url with subfolder install" do
|
||||
set_subfolder "/forum"
|
||||
post = Fabricate(:post)
|
||||
|
||||
expect(post.full_url).to eq(
|
||||
"#{Discourse.base_url_no_prefix}/forum/t/#{post.topic.slug}/#{post.topic.id}/#{post.post_number}",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe "public_posts_count_per_day" do
|
||||
before do
|
||||
freeze_time_safe
|
||||
|
Reference in New Issue
Block a user