diff options
author | George Claghorn <george@basecamp.com> | 2017-07-04 14:01:03 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2017-07-04 14:01:03 -0400 |
commit | 5159d030fad632ac544555541ab1c85ac132874e (patch) | |
tree | 5182fd6b7d074f0cbabcb1dfd4d9501b32c5e5de /test/site | |
parent | e635dac88f0dfcc36a2313c10f860cb6e3a52cfa (diff) | |
download | rails-5159d030fad632ac544555541ab1c85ac132874e.tar.gz rails-5159d030fad632ac544555541ab1c85ac132874e.tar.bz2 rails-5159d030fad632ac544555541ab1c85ac132874e.zip |
ActiveFile::Site::GCSSite#url
Diffstat (limited to 'test/site')
-rw-r--r-- | test/site/gcs_site_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/site/gcs_site_test.rb b/test/site/gcs_site_test.rb index c5f32a0595..f6848b2fe9 100644 --- a/test/site/gcs_site_test.rb +++ b/test/site/gcs_site_test.rb @@ -2,9 +2,17 @@ require "site/shared_site_tests" if SITE_CONFIGURATIONS[:gcs] class ActiveFile::Site::GCSSiteTest < ActiveSupport::TestCase - SITE = ActiveFile::Site.configure(:GCS, SITE_CONFIGURATIONS[:gcs]) + SITE = ActiveFile::Site.configure(:GCS, SITE_CONFIGURATIONS[:gcs]) + SIGNER = Google::Cloud::Storage::File::Signer.from_bucket(SITE.bucket, ActiveFile::Site::SharedSiteTests::FIXTURE_KEY) include ActiveFile::Site::SharedSiteTests + + test "signed URL generation" do + travel_to Time.now do + assert_equal SIGNER.signed_url(expires: 120) + "&response-content-disposition=inline%3B+filename%3D%22test.txt%22", + @site.url(FIXTURE_KEY, expires_in: 2.minutes, disposition: :inline, filename: "test.txt") + end + end end else puts "Skipping GCS Site tests because no GCS configuration was supplied" |