summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-09-07 00:29:03 +0000
committerMichael Kozono <mkozono@gmail.com>2019-09-07 00:29:03 +0000
commit8c3d0703ed71e9ac166b221146176a3ea7e23989 (patch)
treed40d8446bf384a0cffb95e818bbeac4f55221a8a /spec/models
parent7920ff1147051324e63c6b28cd93ca616d5b3165 (diff)
downloadgitlab-ce-8c3d0703ed71e9ac166b221146176a3ea7e23989.tar.gz
Allow to load ECDSA certificates for pages domains
Just replace RSA.new with PKey.read
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/pages_domain_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index 519c519fbcf..5168064bb84 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -151,6 +151,24 @@ describe PagesDomain do
end
end
end
+
+ context 'with ecdsa certificate' do
+ it "is valid" do
+ domain = build(:pages_domain, :ecdsa)
+
+ expect(domain).to be_valid
+ end
+
+ context 'when curve is set explicitly by parameters' do
+ it 'adds errors to private key' do
+ domain = build(:pages_domain, :explicit_ecdsa)
+
+ expect(domain).to be_invalid
+
+ expect(domain.errors[:key]).not_to be_empty
+ end
+ end
+ end
end
describe 'validations' do