Commit 8ffa0ff

mo <mo@mokhan.ca>
2018-08-09 22:45:07
return unspecified nameid format. tag: v1.0.17
1 parent ae94a33
Changed files (2)
lib
saml
kit
spec
saml
kit
lib/saml/kit/builders/assertion.rb
@@ -69,7 +69,7 @@ module Saml
         end
 
         def name_id_options
-          name_id_format.blank? ? {} : { Format: name_id_format }
+          { Format: name_id_format || Saml::Kit::Namespaces::UNSPECIFIED_NAMEID }
         end
       end
     end
spec/saml/kit/builders/response_spec.rb
@@ -179,7 +179,7 @@ RSpec.describe Saml::Kit::Builders::Response do
       authnrequest = Saml::Kit::AuthenticationRequest.new(xml)
       user = User.new(name_id: FFaker::Internet.email)
       result = Saml::Kit::Response.build(user, authnrequest)
-      expect(result.assertion.name_id_format).to be_nil
+      expect(result.assertion.name_id_format).to eql(Saml::Kit::Namespaces::UNSPECIFIED_NAMEID)
     end
   end