2019-06-13 07:37:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ::Gitlab::LetsEncrypt do
|
|
|
|
include LetsEncryptHelpers
|
|
|
|
|
|
|
|
before do
|
|
|
|
stub_lets_encrypt_settings
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '.enabled?' do
|
2019-07-12 12:53:44 -04:00
|
|
|
subject { described_class.enabled? }
|
2019-06-13 07:37:45 -04:00
|
|
|
|
|
|
|
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
|
2019-10-09 23:06:28 -04:00
|
|
|
|
|
|
|
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
|
2019-06-13 07:37:45 -04:00
|
|
|
end
|