Commit b37152e

mo <mo.khan@gmail.com>
2017-11-19 17:45:13
update logout request stubs.
1 parent b2043e4
Changed files (2)
lib/saml/kit/logout_request.rb
@@ -15,7 +15,7 @@ module Saml
       def single_logout_service
         return if provider.nil?
         urls = provider.single_logout_services
-        return urls.first[:location] if urls.any?
+        urls.first
       end
 
       def response_for(user)
spec/saml/logout_request_spec.rb
@@ -38,7 +38,7 @@ RSpec.describe Saml::Kit::LogoutRequest do
       allow(registry).to receive(:metadata_for).and_return(metadata)
       allow(metadata).to receive(:matches?).and_return(true)
       allow(metadata).to receive(:single_logout_services).and_return([
-        { location: FFaker::Internet.http_url, binding: Saml::Kit::Namespaces::POST }
+        Saml::Kit::HttpPostBinding.new(location: FFaker::Internet.http_url)
       ])
     end
 
@@ -94,7 +94,7 @@ RSpec.describe Saml::Kit::LogoutRequest do
       allow(registry).to receive(:metadata_for).with(builder.issuer).and_return(metadata)
       allow(metadata).to receive(:matches?).and_return(true)
       allow(metadata).to receive(:single_logout_services).and_return([
-        { location: FFaker::Internet.http_url, binding: Saml::Kit::Namespaces::POST }
+        Saml::Kit::HttpPostBinding.new(location: FFaker::Internet.http_url)
       ])
 
       expect(builder.build).to be_valid