debian-mirror-gitlab/spec/initializers/fog_google_https_private_urls_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
652 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
2018-05-09 12:01:36 +05:30
let(:storage) do
Fog.mock!
2018-11-08 19:23:39 +05:30
Fog::Storage.new(
google_storage_access_key_id: "asdf",
google_storage_secret_access_key: "asdf",
provider: "Google"
)
2018-05-09 12:01:36 +05:30
end
let(:file) do
2021-04-29 21:17:54 +05:30
# rubocop:disable Rails/SaveBang
2018-05-09 12:01:36 +05:30
directory = storage.directories.create(key: 'data')
directory.files.create(
body: 'Hello World!',
key: 'hello_world.txt'
)
2021-04-29 21:17:54 +05:30
# rubocop:enable Rails/SaveBang
2018-05-09 12:01:36 +05:30
end
it 'delegates to #get_https_url' do
expect(file.url(Time.now)).to start_with("https://")
end
end