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

lets_encrypt_spec.rb « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f07eac1e09a00a5c16b4b4866584d0512b649af6 (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
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ::Gitlab::LetsEncrypt, feature_category: :pages do
  include LetsEncryptHelpers

  before do
    stub_lets_encrypt_settings
  end

  describe '.enabled?' do
    subject { described_class.enabled? }

    context 'when terms of service are accepted' do
      it { is_expected.to eq(true) }
    end

    context 'when terms of service are not accepted' do
      before do
        stub_application_setting(lets_encrypt_terms_of_service_accepted: false)
      end

      it { is_expected.to eq(false) }
    end
  end

  describe '.terms_of_service_url' do
    before do
      stub_lets_encrypt_client
    end

    subject { described_class.terms_of_service_url }

    it 'returns the url' do
      is_expected.to eq("https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf")
    end
  end
end