ActiveVault::Site::MirrorSite#url
This commit is contained in:
parent
abda6d784e
commit
5869045f2e
@ -25,6 +25,10 @@ def exist?(key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def url(key, **options)
|
||||||
|
primary_site.url(key, **options)
|
||||||
|
end
|
||||||
|
|
||||||
def byte_size(key)
|
def byte_size(key)
|
||||||
primary_site.byte_size(key)
|
primary_site.byte_size(key)
|
||||||
end
|
end
|
||||||
|
@ -9,7 +9,7 @@ class ActiveVault::Site::MirrorSiteTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
include ActiveVault::Site::SharedSiteTests
|
include ActiveVault::Site::SharedSiteTests
|
||||||
|
|
||||||
test "uploading was done to all sites" do
|
test "uploading to all sites" do
|
||||||
begin
|
begin
|
||||||
key = SecureRandom.base58(24)
|
key = SecureRandom.base58(24)
|
||||||
data = "Something else entirely!"
|
data = "Something else entirely!"
|
||||||
@ -27,4 +27,11 @@ class ActiveVault::Site::MirrorSiteTest < ActiveSupport::TestCase
|
|||||||
assert PRIMARY_DISK_SITE.exist?(FIXTURE_KEY)
|
assert PRIMARY_DISK_SITE.exist?(FIXTURE_KEY)
|
||||||
assert SECONDARY_DISK_SITE.exist?(FIXTURE_KEY)
|
assert SECONDARY_DISK_SITE.exist?(FIXTURE_KEY)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "URL generation for primary site" do
|
||||||
|
travel_to Time.now do
|
||||||
|
assert_equal PRIMARY_DISK_SITE.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "test.txt"),
|
||||||
|
SITE.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "test.txt")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user