spec/rails/auth/x509/matcher_spec.rb in rails-auth-0.0.1 vs spec/rails/auth/x509/matcher_spec.rb in rails-auth-0.1.0
- old
+ new
@@ -1,21 +1,21 @@
RSpec.describe Rails::Auth::X509::Matcher do
- let(:example_cert) { OpenSSL::X509::Certificate.new(cert_path("valid.crt").read) }
- let(:example_principal) { Rails::Auth::X509::Principal.new(example_cert) }
+ let(:example_cert) { OpenSSL::X509::Certificate.new(cert_path("valid.crt").read) }
+ let(:example_certificate) { Rails::Auth::X509::Certificate.new(example_cert) }
let(:example_ou) { "ponycopter" }
let(:another_ou) { "somethingelse" }
let(:example_env) do
- { Rails::Auth::PRINCIPALS_ENV_KEY => { "x509" => example_principal } }
+ { Rails::Auth::CREDENTIALS_ENV_KEY => { "x509" => example_certificate } }
end
- it "matches against a valid Rails::Auth::X509::Principal" do
- predicate = described_class.new(ou: example_ou)
- expect(predicate.match(example_env)).to eq true
+ it "matches against a valid Rails::Auth::X509::Credential" do
+ matcher = described_class.new(ou: example_ou)
+ expect(matcher.match(example_env)).to eq true
end
it "doesn't match if the subject mismatches" do
- predicate = described_class.new(ou: another_ou)
- expect(predicate.match(example_env)).to eq false
+ matcher = described_class.new(ou: another_ou)
+ expect(matcher.match(example_env)).to eq false
end
end