mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
FIX: subfolder digest emails have incorrect URLs
This commit is contained in:
@@ -127,9 +127,7 @@ describe UserNotifications do
|
||||
|
||||
context "with new topics" do
|
||||
|
||||
before do
|
||||
Fabricate(:topic, user: Fabricate(:coding_horror), created_at: 1.hour.ago)
|
||||
end
|
||||
let!(:popular_topic) { Fabricate(:topic, user: Fabricate(:coding_horror), created_at: 1.hour.ago) }
|
||||
|
||||
it "works" do
|
||||
expect(subject.to).to eq([user.email])
|
||||
@@ -206,6 +204,22 @@ describe UserNotifications do
|
||||
expect(html).to include '1E1E1E'
|
||||
expect(html).to include '858585'
|
||||
end
|
||||
|
||||
it "supports subfolder" do
|
||||
GlobalSetting.stubs(:relative_url_root).returns('/forum')
|
||||
Discourse.stubs(:base_uri).returns("/forum")
|
||||
html = subject.html_part.body.to_s
|
||||
text = subject.text_part.body.to_s
|
||||
expect(html).to be_present
|
||||
expect(text).to be_present
|
||||
expect(html).to_not include("/forum/forum")
|
||||
expect(text).to_not include("/forum/forum")
|
||||
expect(subject.header["List-Unsubscribe"].to_s).to match(/http:\/\/test.localhost\/forum\/email\/unsubscribe\/\h{64}/)
|
||||
|
||||
topic_url = "http://test.localhost/forum/t/#{popular_topic.slug}/#{popular_topic.id}"
|
||||
expect(html).to include(topic_url)
|
||||
expect(text).to include(topic_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user