ActiveVault::Site::MirrorSite#url

This commit is contained in:
George Claghorn 2017-07-05 18:31:19 -04:00
parent abda6d784e
commit 5869045f2e
2 changed files with 14 additions and 3 deletions

@ -25,6 +25,10 @@ def exist?(key)
end
def url(key, **options)
primary_site.url(key, **options)
end
def byte_size(key)
primary_site.byte_size(key)
end

@ -9,7 +9,7 @@ class ActiveVault::Site::MirrorSiteTest < ActiveSupport::TestCase
include ActiveVault::Site::SharedSiteTests
test "uploading was done to all sites" do
test "uploading to all sites" do
begin
key = SecureRandom.base58(24)
data = "Something else entirely!"
@ -27,4 +27,11 @@ class ActiveVault::Site::MirrorSiteTest < ActiveSupport::TestCase
assert PRIMARY_DISK_SITE.exist?(FIXTURE_KEY)
assert SECONDARY_DISK_SITE.exist?(FIXTURE_KEY)
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