Commit 4343d46
Changed files (2)
lib
saml
kit
spec
saml
kit
lib/saml/kit/document.rb
@@ -29,7 +29,7 @@ module Saml
# Returns the ID for the SAML document.
def id
- root.fetch('ID', nil)
+ at_xpath('./*/@ID').try(:value)
end
# Returns the Issuer for the SAML document.
spec/saml/kit/document_spec.rb
@@ -1,4 +1,16 @@
RSpec.describe Saml::Kit::Document do
+ subject do
+ Saml::Kit::AuthenticationRequest.build do |x|
+ x.id = id
+ x.issuer = issuer
+ end
+ end
+ let(:id) { Xml::Kit::Id.generate }
+ let(:issuer) { FFaker::Internet.uri("https") }
+
+ specify { expect(subject.id).to eql(id) }
+ specify { expect(subject.issuer).to eql(issuer) }
+
describe '.to_saml_document' do
subject { described_class }