Commit 33009d42 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '33230-undefined-method-terms_of_service_url' into 'master'

Resolve "Undefined method `terms_of_service_url'"

See merge request gitlab-org/gitlab!18263
parents 730ace4f aa7cde44
---
title: Fix 500 error on clicking to LetsEncrypt Terms of Service
merge_request: 18263
author:
type: fixed
......@@ -5,5 +5,9 @@ module Gitlab
def self.enabled?
Gitlab::CurrentSettings.lets_encrypt_terms_of_service_accepted
end
def self.terms_of_service_url
::Gitlab::LetsEncrypt::Client.new.terms_of_service_url
end
end
end
......@@ -143,4 +143,22 @@ describe Admin::ApplicationSettingsController do
expect(response).to redirect_to(admin_runners_path)
end
end
describe 'GET #lets_encrypt_terms_of_service' do
include LetsEncryptHelpers
before do
sign_in(admin)
stub_lets_encrypt_client
end
subject { get :lets_encrypt_terms_of_service }
it 'redirects the user to the terms of service page' do
subject
expect(response).to redirect_to("https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf")
end
end
end
......@@ -24,4 +24,16 @@ describe ::Gitlab::LetsEncrypt do
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment