gitlab-org--gitlab-foss/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

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
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"
)
end
let(:file) do
# rubocop:disable Rails/SaveBang
directory = storage.directories.create(key: 'data')
directory.files.create(
body: 'Hello World!',
key: 'hello_world.txt'
)
# rubocop:enable Rails/SaveBang
end
it 'delegates to #get_https_url' do
expect(file.url(Time.now)).to start_with("https://")
end
end