mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: inline_uploads not working on subfolder setups
This commit is contained in:
@@ -206,6 +206,28 @@ RSpec.describe InlineUploads do
|
||||
MD
|
||||
end
|
||||
|
||||
context "subfolder" do
|
||||
before do
|
||||
global_setting :relative_url_root, "/community"
|
||||
ActionController::Base.config.relative_url_root = "/community"
|
||||
end
|
||||
|
||||
after do
|
||||
ActionController::Base.config.relative_url_root = nil
|
||||
end
|
||||
|
||||
it "should correct subfolder images" do
|
||||
|
||||
md = <<~MD
|
||||
<img src="/community#{upload.url}">
|
||||
MD
|
||||
|
||||
expect(InlineUploads.process(md)).to eq(<<~MD)
|
||||

|
||||
MD
|
||||
end
|
||||
end
|
||||
|
||||
it "should correct raw image URLs to the short url and paths" do
|
||||
md = <<~MD
|
||||
#{Discourse.base_url}#{upload.url}
|
||||
|
||||
Reference in New Issue
Block a user