Fix the build a3938f98f8
.
This commit is contained in:
parent
a3938f98f8
commit
8d1b0224ac
|
@ -303,12 +303,20 @@ describe FileStore::S3Store do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".path_for" do
|
describe ".path_for" do
|
||||||
it "correctly falls back to local" do
|
def assert_path(path, expected)
|
||||||
local_upload = Fabricate(:upload)
|
upload = Upload.new(url: path)
|
||||||
s3_upload = Fabricate(:upload_s3)
|
|
||||||
|
|
||||||
expect(Discourse.store.path_for(local_upload)).to eq(local_upload.url)
|
path = store.path_for(upload)
|
||||||
expect(Discourse.store.path_for(s3_upload)).to eq(s3_upload.url)
|
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)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue