@@ -633,15 +633,15 @@ def generate_audience_error(expected, actual)
633633 :skip_conditions => true ,
634634 :skip_subject_confirmation => true } )
635635 }
636-
636+
637637 it "be able to parse the response wihout errors" do
638638 response_with_formatted_x509certificate . settings = settings
639- response_with_formatted_x509certificate . settings . idp_cert = ruby_saml_cert_text
639+ response_with_formatted_x509certificate . settings . idp_cert = ruby_saml_cert_text
640640 assert response_with_formatted_x509certificate . is_valid?
641641 assert_empty response_with_formatted_x509certificate . errors
642642 end
643643 end
644-
644+
645645 describe "#validate_in_response_to" do
646646 it "return true when the inResponseTo value matches the Request ID" do
647647 response = OneLogin ::RubySaml ::Response . new ( response_document_valid_signed , :settings => settings , :matches_request_id => "_fc4a34b0-7efb-012e-caae-782bcb13bb38" )
@@ -1072,6 +1072,24 @@ def generate_audience_error(expected, actual)
10721072 )
10731073 assert special_response_with_saml2_namespace . send ( :validate_conditions )
10741074 end
1075+
1076+ Timecop . freeze ( Time . parse ( "2011-06-14T18:21:01Z" ) ) do
1077+ settings . soft = true
1078+ special_response_with_saml2_namespace = OneLogin ::RubySaml ::Response . new (
1079+ response_document_with_saml2_namespace ,
1080+ :allowed_clock_drift => '0.515' ,
1081+ :settings => settings
1082+ )
1083+ assert !special_response_with_saml2_namespace . send ( :validate_conditions )
1084+ end
1085+
1086+ Timecop . freeze ( Time . parse ( "2011-06-14T18:21:01Z" ) ) do
1087+ special_response_with_saml2_namespace = OneLogin ::RubySaml ::Response . new (
1088+ response_document_with_saml2_namespace ,
1089+ :allowed_clock_drift => '0.516'
1090+ )
1091+ assert special_response_with_saml2_namespace . send ( :validate_conditions )
1092+ end
10751093 end
10761094 end
10771095
0 commit comments