2017-07-06 06:22:44 -04:00
|
|
|
require "service/shared_service_tests"
|
|
|
|
|
|
|
|
class ActiveStorage::Service::DiskServiceTest < ActiveSupport::TestCase
|
2017-07-09 07:23:21 -04:00
|
|
|
SERVICE = ActiveStorage::Service::DiskService.new(root: File.join(Dir.tmpdir, "active_storage"))
|
2017-07-06 06:22:44 -04:00
|
|
|
|
|
|
|
include ActiveStorage::Service::SharedServiceTests
|
2017-07-09 11:04:37 -04:00
|
|
|
|
|
|
|
test "url generation" do
|
2017-07-27 16:15:38 -04:00
|
|
|
assert_match /rails\/active_storage\/disk\/.*\/avatar\.png\?.+disposition=inline/,
|
2017-07-23 18:50:31 -04:00
|
|
|
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png", content_type: "image/png")
|
2017-07-09 11:04:37 -04:00
|
|
|
end
|
2017-07-06 06:22:44 -04:00
|
|
|
end
|