mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Support [description|attachment](upload://<short-sha>) in MD take 2.
Previous attempt was missing `post_uploads` records.
This commit is contained in:
@@ -303,21 +303,12 @@ describe FileStore::S3Store do
|
||||
end
|
||||
|
||||
describe ".path_for" do
|
||||
|
||||
def assert_path(path, expected)
|
||||
upload = Upload.new(url: path)
|
||||
|
||||
path = store.path_for(upload)
|
||||
expected = FileStore::LocalStore.new.path_for(upload) if expected
|
||||
|
||||
expect(path).to eq(expected)
|
||||
end
|
||||
|
||||
it "correctly falls back to local" do
|
||||
assert_path("/hello", "/hello")
|
||||
assert_path("//hello", nil)
|
||||
assert_path("http://hello", nil)
|
||||
assert_path("https://hello", nil)
|
||||
local_upload = Fabricate(:upload)
|
||||
s3_upload = Fabricate(:upload_s3)
|
||||
|
||||
expect(Discourse.store.path_for(local_upload)).to eq(local_upload.url)
|
||||
expect(Discourse.store.path_for(s3_upload)).to eq(s3_upload.url)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user