Commit 25dc015

mo <mo.khan@gmail.com>
2018-02-26 02:57:46
parse expected type with xpath.
1 parent a9463f1
Changed files (2)
lib
saml
spec
lib/saml/kit/document.rb
@@ -144,7 +144,7 @@ module Saml
       end
 
       def expected_type?
-        to_h[name].present?
+        at_xpath("./samlp:#{name}").present?
       end
 
       def must_be_valid_version
spec/saml/kit/document_spec.rb
@@ -16,6 +16,7 @@ RSpec.describe Saml::Kit::Document do
   specify { expect(subject.version).to eql('2.0') }
   specify { expect(subject.destination).to eql(destination) }
   specify { expect(subject.issue_instant.to_i).to eql(Time.now.to_i) }
+  specify { expect(Saml::Kit::AuthenticationRequest.new('blah').id).to be_nil }
 
   describe '.to_saml_document' do
     subject { described_class }