Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fog_google_https_private_urls_spec.rb « initializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4825525a3d844de4bba15021f9599dc722a68ef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
  let(:storage) do
    Fog.mock!
    Fog::Storage.new(
      google_storage_access_key_id: "asdf",
      google_storage_secret_access_key: "asdf",
      provider: "Google"
    )
  end

  let(:file) do
    directory = storage.directories.create(key: 'data')
    directory.files.create(
      body: 'Hello World!',
      key: 'hello_world.txt'
    )
  end

  it 'delegates to #get_https_url' do
    expect(file.url(Time.now)).to start_with("https://")
  end
end