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

challenge_spec.rb « lets_encrypt « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74622f356de88871dfb9516b025b325b2dd22ef8 (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
27
28
29
# frozen_string_literal: true

require 'spec_helper'

describe ::Gitlab::LetsEncrypt::Challenge do
  delegated_methods = {
    url: 'https://example.com/',
    status: 'pending',
    token: 'tokenvalue',
    file_content: 'hereisfilecontent',
    request_validation: true
  }

  let(:acme_challenge) do
    acme_challenge = instance_double('Acme::Client::Resources::Challenge')
    allow(acme_challenge).to receive_messages(delegated_methods)
    acme_challenge
  end

  let(:challenge) { described_class.new(acme_challenge) }

  delegated_methods.each do |method, value|
    describe "##{method}" do
      it 'delegates to Acme::Client::Resources::Challenge' do
        expect(challenge.public_send(method)).to eq(value)
      end
    end
  end
end