Sha256: 8f583a1f3968283ba02e78cd2559f3a4b46b593b5b3f8513146517ff092aedbe

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

RSpec.describe Rails::Auth::X509::Principal do
  let(:example_cert)      { OpenSSL::X509::Certificate.new(cert_path("valid.crt").read) }
  let(:example_principal) { described_class.new(example_cert) }

  let(:example_cn) { "127.0.0.1" }
  let(:example_ou) { "ponycopter" }

  describe "#[]" do
    it "allows access to subject components via strings" do
      expect(example_principal["CN"]).to eq example_cn
      expect(example_principal["OU"]).to eq example_ou
    end

    it "allows access to subject components via symbols" do
      expect(example_principal[:cn]).to eq example_cn
      expect(example_principal[:ou]).to eq example_ou
    end
  end

  it "knows its #cn" do
    expect(example_principal.cn).to eq example_cn
  end

  it "knows its #ou" do
    expect(example_principal.ou).to eq example_ou
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-auth-0.0.1 spec/rails/auth/x509/principal_spec.rb