diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-16 16:39:58 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-02-01 01:53:58 +0300 |
commit | 8f09ec28379da331fb5bd4a4da950def7b83dd94 (patch) | |
tree | 2819a9c4a18114ca852dbf7401b3eac26aa6e66c /spec/models | |
parent | 3bcb65c9f2ceaa4213c6d3eb1641ecb0f07d35ad (diff) |
Verify trusted certificate chain
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/pages_domain_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index 929b2a26549..3e083ba9001 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -63,7 +63,7 @@ describe PagesDomain, models: true do end context 'for not matching key' do - let(:domain) { build(:pages_domain, :with_certificate_chain, :with_key) } + let(:domain) { build(:pages_domain, :with_missing_chain, :with_key) } it { is_expected.to_not be_valid } end @@ -95,7 +95,7 @@ describe PagesDomain, models: true do end context 'for invalid key' do - let(:domain) { build(:pages_domain, :with_certificate_chain, :with_key) } + let(:domain) { build(:pages_domain, :with_missing_chain, :with_key) } it { is_expected.to be_falsey } end @@ -110,11 +110,17 @@ describe PagesDomain, models: true do it { is_expected.to be_truthy } end - context 'for certificate chain without the root' do - let(:domain) { build(:pages_domain, :with_certificate_chain) } + context 'for missing certificate chain' do + let(:domain) { build(:pages_domain, :with_missing_chain) } it { is_expected.to be_falsey } end + + context 'for trusted certificate chain' do + let(:domain) { build(:pages_domain, :with_trusted_chain) } + + it { is_expected.to be_truthy } + end end describe :expired? do |