Commit 67c41f9

mo <mo@mokhan.ca>
2018-09-17 19:50:12
make Assertions buildable.
1 parent 4df17ef
Changed files (2)
lib
spec
lib/saml/kit/assertion.rb
@@ -7,6 +7,7 @@ module Saml
     # of a SAML document.
     class Assertion
       include ActiveModel::Validations
+      include Buildable
       include Translatable
       include XmlParseable
       extend Forwardable
@@ -88,6 +89,12 @@ module Saml
         @to_nokogiri.to_s
       end
 
+      class << self
+        def builder_class
+          Saml::Kit::Builders::Assertion
+        end
+      end
+
       private
 
       attr_reader :configuration
spec/saml/kit/assertion_spec.rb
@@ -2,9 +2,9 @@
 
 RSpec.describe Saml::Kit::Assertion do
   subject do
-    Saml::Kit::Response.build(user, request) do |x|
+    described_class.build(user, request, true) do |x|
       x.issuer = entity_id
-    end.assertion
+    end
   end
 
   let(:request) { instance_double(Saml::Kit::AuthenticationRequest, id: ::Xml::Kit::Id.generate, issuer: FFaker::Internet.uri('https'), assertion_consumer_service_url: FFaker::Internet.uri('https'), name_id_format: Saml::Kit::Namespaces::PERSISTENT, provider: nil, signed?: true, trusted?: true) }