2019-10-20 17:06:17 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-14 04:53:37 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
|
2018-02-14 04:53:37 -05:00
|
|
|
let(:storage) do
|
|
|
|
Fog.mock!
|
2018-06-05 10:17:04 -04:00
|
|
|
Fog::Storage.new(
|
|
|
|
google_storage_access_key_id: "asdf",
|
|
|
|
google_storage_secret_access_key: "asdf",
|
|
|
|
provider: "Google"
|
|
|
|
)
|
2018-02-14 04:53:37 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
let(:file) do
|
2021-04-07 14:09:45 -04:00
|
|
|
# rubocop:disable Rails/SaveBang
|
2018-02-14 04:53:37 -05:00
|
|
|
directory = storage.directories.create(key: 'data')
|
|
|
|
directory.files.create(
|
|
|
|
body: 'Hello World!',
|
|
|
|
key: 'hello_world.txt'
|
|
|
|
)
|
2021-04-07 14:09:45 -04:00
|
|
|
# rubocop:enable Rails/SaveBang
|
2018-02-14 04:53:37 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'delegates to #get_https_url' do
|
|
|
|
expect(file.url(Time.now)).to start_with("https://")
|
|
|
|
end
|
|
|
|
end
|