debian-mirror-gitlab/spec/lib/gitlab/kubernetes/helm/v2/certificate_spec.rb

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

29 lines
845 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
require 'spec_helper'
2021-01-29 00:20:46 +05:30
RSpec.describe Gitlab::Kubernetes::Helm::V2::Certificate do
2018-11-18 11:00:15 +05:30
describe '.generate_root' do
subject { described_class.generate_root }
2019-07-07 11:18:12 +05:30
it 'generates a root CA that expires a long way in the future' do
2018-11-18 11:00:15 +05:30
expect(subject.cert.not_after).to be > 999.years.from_now
end
end
describe '#issue' do
subject { described_class.generate_root.issue }
2019-07-07 11:18:12 +05:30
it 'generates a cert that expires soon' do
2018-11-18 11:00:15 +05:30
expect(subject.cert.not_after).to be < 60.minutes.from_now
end
context 'passing in INFINITE_EXPIRY' do
subject { described_class.generate_root.issue(expires_in: described_class::INFINITE_EXPIRY) }
2019-07-07 11:18:12 +05:30
it 'generates a cert that expires a long way in the future' do
2018-11-18 11:00:15 +05:30
expect(subject.cert.not_after).to be > 999.years.from_now
end
end
end
end