debian-mirror-gitlab/spec/lib/gitlab/lets_encrypt_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
841 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe ::Gitlab::LetsEncrypt do
2019-09-30 21:07:59 +05:30
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
2019-12-21 20:55:43 +05:30
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-09-30 21:07:59 +05:30
end