Commit aff80e6

mo <mo.khan@gmail.com>
2017-11-01 21:29:08
it parses the entityID
1 parent 1422d48
lib/saml/kit/service_provider_metadata.rb
@@ -5,6 +5,10 @@ module Saml
         super("SPSSODescriptor", xml)
       end
 
+      def entity_id
+        find_by("/md:EntityDescriptor/@entityID").value
+      end
+
       def name_id_formats
         find_all("/md:EntityDescriptor/md:SPSSODescriptor/md:NameIDFormat").map do |item|
           item.text
spec/saml/service_provider_metadata_spec.rb
@@ -87,5 +87,9 @@ RSpec.describe Saml::Kit::ServiceProviderMetadata do
         Saml::Kit::Namespaces::Formats::NameId::PERSISTENT
       ])
     end
+
+    it 'returns the entity id' do
+      expect(subject.entity_id).to eql(entity_id)
+    end
   end
 end