mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 05:53:52 +08:00
Normalize URL from Feed Entry after adding link to original in Topic
Since a URL might be case sensitive, adding a link to the original Feed Entry with changed case to the Topic could end in 404.
This commit is contained in:
@ -41,6 +41,17 @@ describe TopicEmbed do
|
||||
post.cooked.should =~ /new contents/
|
||||
end
|
||||
|
||||
it "Should leave uppercase Feed Entry URL untouched in content" do
|
||||
cased_url = 'http://eviltrout.com/ABCD'
|
||||
post = TopicEmbed.import(user, cased_url, title, "some random content")
|
||||
post.cooked.should =~ /#{cased_url}/
|
||||
end
|
||||
|
||||
it "Should leave lowercase Feed Entry URL untouched in content" do
|
||||
cased_url = 'http://eviltrout.com/abcd'
|
||||
post = TopicEmbed.import(user, cased_url, title, "some random content")
|
||||
post.cooked.should =~ /#{cased_url}/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user