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

http_helper_spec.rb « spec « gitlab-shell « ruby - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5a1fe631ec35bbd964007f2f4e7ca92f00092453 (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
require_relative 'spec_helper'
require_relative '../lib/http_helper'

class GitlabNet
  include HTTPHelper

  def client(uri)
    http_client_for(uri)
  end
end

describe HTTPHelper do
  let(:config_data) { {'http_settings' => { 'user' => 'user_123', 'password' =>'password123', 'ca_file' => '', 'ca_path' => '', 'read_timeout' => 200, 'self_signed' => true } } }

  before do
    allow(ENV).to receive(:fetch).with('GITALY_GITLAB_SHELL_CONFIG', '{}').and_return(config_data.to_json)
  end

  it 'creates an https client when ca_file and ca_path are empty' do
    gitlab_net = GitlabNet.new

    expect { gitlab_net.client(URI('https://localhost:8080')) }.not_to raise_error
  end
end