Generate HTTP URLs for custom Pages domains when appropriate

This commit is contained in:
Nick Thomas 2018-01-08 01:27:19 +00:00
parent 2c66b942bd
commit 75e718f207
No known key found for this signature in database
GPG Key ID: 2A313A47AFADACE9
3 changed files with 7 additions and 2 deletions

View File

@ -27,7 +27,7 @@ class PagesDomain < ActiveRecord::Base
def url
return unless domain
if certificate
if certificate.present?
"https://#{domain}"
else
"http://#{domain}"

View File

@ -0,0 +1,5 @@
---
title: Generate HTTP URLs for custom Pages domains when appropriate
merge_request: 16279
author:
type: fixed

View File

@ -68,7 +68,7 @@ describe PagesDomain do
subject { domain.url }
context 'without the certificate' do
let(:domain) { build(:pages_domain) }
let(:domain) { build(:pages_domain, certificate: '') }
it { is_expected.to eq('http://my.domain.com') }
end