spec/rails/auth/x509/middleware_spec.rb in rails-auth-2.1.2 vs spec/rails/auth/x509/middleware_spec.rb in rails-auth-2.1.3

- old
+ new

@@ -31,9 +31,16 @@ it "ignores unverified certificates" do _response, env = middleware.call(request.merge(example_key => bad_cert_pem)) expect(Rails::Auth.credentials(env)).to be_empty end + + it "normalizes abnormal whitespace" do + _response, env = middleware.call(request.merge(example_key => valid_cert_pem.tr("\n", "\t"))) + + credential = Rails::Auth.credentials(env).fetch("x509") + expect(credential).to be_a Rails::Auth::X509::Certificate + end end # :nocov: describe "Java certificates" do let(:example_key) { "javax.servlet.request.X509Certificate" }