Commit 9f5e75e

mo <mo@mokhan.ca>
2017-12-04 20:25:17
add spec for parsing .from
1 parent 5a67683
Changed files (1)
spec/saml/metadata_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+RSpec.describe Saml::Kit::Metadata do
+  describe ".from" do
+    subject { described_class }
+
+    it 'returns an identity provider metadata' do
+      xml = Saml::Kit::IdentityProviderMetadata.build.to_xml
+      expect(subject.from(xml)).to be_instance_of(Saml::Kit::IdentityProviderMetadata)
+    end
+
+    it 'returns a service provider metadata' do
+      xml = Saml::Kit::ServiceProviderMetadata.build.to_xml
+      expect(subject.from(xml)).to be_instance_of(Saml::Kit::ServiceProviderMetadata)
+    end
+  end
+end