mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Simplify Active Storage config for test env
This commit is contained in:
@@ -11,7 +11,7 @@ class ReportBlob < ActiveStorage::Blob
|
||||
filename:,
|
||||
content_type: content_type(filename),
|
||||
identify: false,
|
||||
service_name:,
|
||||
service_name: :local,
|
||||
)
|
||||
end
|
||||
|
||||
@@ -19,14 +19,6 @@ class ReportBlob < ActiveStorage::Blob
|
||||
MIME::Types.of(filename).first&.to_s || "application/octet-stream"
|
||||
end
|
||||
|
||||
def self.service_name
|
||||
if Rails.env.test?
|
||||
:test
|
||||
else
|
||||
:local
|
||||
end
|
||||
end
|
||||
|
||||
def result
|
||||
@result ||= download.force_encoding(Encoding::UTF_8)
|
||||
end
|
||||
|
||||
@@ -56,6 +56,4 @@ Openfoodnetwork::Application.configure do
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
config.active_job.queue_adapter = :test
|
||||
|
||||
config.active_storage.service = :test
|
||||
end
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
local:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("storage") %>
|
||||
|
||||
test:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("tmp/storage") %>
|
||||
root: <%= Rails.root.join(Rails.env.test? ? "tmp/storage" : "storage") %>
|
||||
|
||||
test_amazon:
|
||||
service: S3
|
||||
|
||||
Reference in New Issue
Block a user