@@ -276,10 +276,6 @@ def post_xml(xml = :example_response, opts = {})
276276 end
277277
278278 context "when response is a logout response" do
279- before do
280- saml_options [ :slo_enabled ] = true
281- end
282-
283279 before :each do
284280 post "/auth/saml/slo" , {
285281 SAMLResponse : load_xml ( :example_logout_response ) ,
@@ -336,13 +332,21 @@ def post_xml(xml = :example_response, opts = {})
336332 end
337333 end
338334 end
339- end
340335
341- describe 'POST /auth/saml/spslo' do
342- before do
343- saml_options [ :slo_enabled ] = true
336+ context "when SLO is disabled" do
337+ before do
338+ saml_options [ :slo_enabled ] = false
339+ post "/auth/saml/slo"
340+ end
341+
342+ it "should return not implemented" do
343+ expect ( last_response . status ) . to eq 501
344+ expect ( last_response . body ) . to eq "Not Implemented"
345+ end
344346 end
347+ end
345348
349+ describe 'POST /auth/saml/spslo' do
346350 def test_default_relay_state ( static_default_relay_state = nil , &block_default_relay_state )
347351 saml_options [ "slo_default_relay_state" ] = static_default_relay_state || block_default_relay_state
348352 post "/auth/saml/spslo"
@@ -375,6 +379,18 @@ def test_default_relay_state(static_default_relay_state = nil, &block_default_re
375379 expect ( last_response . status ) . to eq 501
376380 expect ( last_response . body ) . to match /Not Implemented/
377381 end
382+
383+ context "when SLO is disabled" do
384+ before do
385+ saml_options [ :slo_enabled ] = false
386+ post "/auth/saml/spslo"
387+ end
388+
389+ it "should return not implemented" do
390+ expect ( last_response . status ) . to eq 501
391+ expect ( last_response . body ) . to eq "Not Implemented"
392+ end
393+ end
378394 end
379395
380396 describe 'POST /auth/saml/metadata' do
0 commit comments