FIX: Chat summary email link in subfolder setups (#25188)

This regressed in 2791e75072. That commit
fixed subfolder URLs in general, but the `full_url` was adding the
subfolder prefix a second time, thus breaking this URL in emails.
This commit is contained in:
Penar Musaraj 2024-01-10 11:52:57 -05:00 committed by GitHub
parent bcb31f79ce
commit 26747540d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -236,7 +236,7 @@ module Chat
end
def full_url
"#{Discourse.base_url}#{url}"
"#{Discourse.base_url_no_prefix}#{url}"
end
def url

View File

@ -637,6 +637,17 @@ describe UserNotifications do
expect(user_avatar.attribute("alt").value).to eq(sender.username)
end
context "with subfolder" do
before { set_subfolder "/community" }
it "includes correct view summary link in template" do
email = described_class.chat_summary(user, {})
expect(email.html_part.body.to_s).to include(
"<a class=\"more-messages-link\" href=\"#{Discourse.base_url}/chat",
)
end
end
context "when there are more than two mentions" do
it "includes a view more link " do
2.times do