@@ -36,7 +36,7 @@ class AuthrequestTest < Minitest::Test
3636 zstream . finish
3737 zstream . close
3838
39- assert_match ( /<samlp:AuthnRequest[^<]* Destination=' http:\/ \/ example.com' / , inflated )
39+ assert_match ( /<samlp:AuthnRequest[^<]* Destination=" http:\/ \/ example\ . com" / , inflated )
4040 end
4141
4242 it "create the SAMLRequest URL parameter without deflating" do
@@ -61,7 +61,7 @@ class AuthrequestTest < Minitest::Test
6161 zstream . finish
6262 zstream . close
6363
64- assert_match ( /<samlp:AuthnRequest[^<]* IsPassive=' true' / , inflated )
64+ assert_match ( /<samlp:AuthnRequest[^<]* IsPassive=" true" / , inflated )
6565 end
6666
6767 it "create the SAMLRequest URL parameter with ProtocolBinding" do
@@ -76,7 +76,7 @@ class AuthrequestTest < Minitest::Test
7676 zstream . finish
7777 zstream . close
7878
79- assert_match ( /<samlp:AuthnRequest[^<]* ProtocolBinding=' urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' / , inflated )
79+ assert_match ( /<samlp:AuthnRequest[^<]* ProtocolBinding=" urn:oasis:names:tc:SAML:2\ . 0:bindings:HTTP-POST" / , inflated )
8080 end
8181
8282 it "create the SAMLRequest URL parameter with AttributeConsumingServiceIndex" do
@@ -90,7 +90,7 @@ class AuthrequestTest < Minitest::Test
9090 inflated = zstream . inflate ( decoded )
9191 zstream . finish
9292 zstream . close
93- assert_match ( /<samlp:AuthnRequest[^<]* AttributeConsumingServiceIndex='30' / , inflated )
93+ assert_match ( /<samlp:AuthnRequest[^<]* AttributeConsumingServiceIndex="30" / , inflated )
9494 end
9595
9696 it "create the SAMLRequest URL parameter with ForceAuthn" do
@@ -104,7 +104,7 @@ class AuthrequestTest < Minitest::Test
104104 inflated = zstream . inflate ( decoded )
105105 zstream . finish
106106 zstream . close
107- assert_match ( /<samlp:AuthnRequest[^<]* ForceAuthn=' true' / , inflated )
107+ assert_match ( /<samlp:AuthnRequest[^<]* ForceAuthn=" true" / , inflated )
108108 end
109109
110110 it "create the SAMLRequest URL parameter with NameID Format" do
@@ -118,8 +118,8 @@ class AuthrequestTest < Minitest::Test
118118 zstream . finish
119119 zstream . close
120120
121- assert_match ( /<samlp:NameIDPolicy[^<]* AllowCreate=' true' / , inflated )
122- assert_match ( /<samlp:NameIDPolicy[^<]* Format=' urn:oasis:names:tc:SAML:2.0:nameid-format:transient' / , inflated )
121+ assert_match ( /<samlp:NameIDPolicy[^<]* AllowCreate=" true" / , inflated )
122+ assert_match ( /<samlp:NameIDPolicy[^<]* Format=" urn:oasis:names:tc:SAML:2\ . 0:nameid-format:transient" / , inflated )
123123 end
124124
125125 it "create the SAMLRequest URL parameter with Subject" do
@@ -135,8 +135,8 @@ class AuthrequestTest < Minitest::Test
135135 zstream . close
136136
137137 assert inflated . include? ( '<saml:Subject>' )
138- assert inflated . include? ( " <saml:NameID Format=' urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' >testuser@example.com</saml:NameID>" )
139- assert inflated . include? ( " <saml:SubjectConfirmation Method=' urn:oasis:names:tc:SAML:2.0:cm:bearer'/>" )
138+ assert inflated . include? ( ' <saml:NameID Format=" urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" >testuser@example.com</saml:NameID>' )
139+ assert inflated . include? ( ' <saml:SubjectConfirmation Method=" urn:oasis:names:tc:SAML:2.0:cm:bearer"/>' )
140140 end
141141
142142 it "accept extra parameters" do
@@ -165,8 +165,8 @@ class AuthrequestTest < Minitest::Test
165165 it "uuid is initialized to nil" do
166166 request = RubySaml ::Authrequest . new
167167
168- assert_nil ( request . uuid )
169- assert_equal request . request_id , request . uuid
168+ assert_nil request . uuid
169+ assert_nil request . request_id
170170 end
171171
172172 it "creates request with ID prefixed with default '_'" do
@@ -199,8 +199,9 @@ class AuthrequestTest < Minitest::Test
199199
200200 it "can mutate the uuid" do
201201 request = RubySaml ::Authrequest . new
202- request_id = request . request_id
203- assert_equal request_id , request . uuid
202+ assert_nil request . uuid
203+ assert_nil request . request_id
204+
204205 request . uuid = "new_uuid"
205206 assert_equal "new_uuid" , request . uuid
206207 assert_equal request . uuid , request . request_id
@@ -224,7 +225,7 @@ class AuthrequestTest < Minitest::Test
224225 it "create the SAMLRequest parameter correctly" do
225226
226227 auth_url = RubySaml ::Authrequest . new . create ( settings )
227- assert_match ( /^http:\/ \/ example.com\? SAMLRequest/ , auth_url )
228+ assert_match ( /^http:\/ \/ example\ . com\? SAMLRequest/ , auth_url )
228229 end
229230 end
230231
@@ -233,7 +234,7 @@ class AuthrequestTest < Minitest::Test
233234 settings . idp_sso_service_url = "http://example.com?field=value"
234235
235236 auth_url = RubySaml ::Authrequest . new . create ( settings )
236- assert_match ( /^http:\/ \/ example.com\? field=value&SAMLRequest/ , auth_url )
237+ assert_match ( /^http:\/ \/ example\ . com\? field=value&SAMLRequest/ , auth_url )
237238 end
238239 end
239240
@@ -253,22 +254,22 @@ class AuthrequestTest < Minitest::Test
253254 it "create the saml:AuthnContextClassRef with comparison exact" do
254255 settings . authn_context = 'secure/name/password/uri'
255256 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
256- assert_match ( /<samlp:RequestedAuthnContext[\S ]+Comparison=' exact' / , auth_doc . to_s )
257+ assert_match ( /<samlp:RequestedAuthnContext[\S ]+Comparison=" exact" / , auth_doc . to_s )
257258 assert_match ( /<saml:AuthnContextClassRef>secure\/ name\/ password\/ uri<\/ saml:AuthnContextClassRef>/ , auth_doc . to_s )
258259 end
259260
260261 it "create the saml:AuthnContextClassRef with comparison minimun" do
261262 settings . authn_context = 'secure/name/password/uri'
262263 settings . authn_context_comparison = 'minimun'
263264 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
264- assert_match ( /<samlp:RequestedAuthnContext[\S ]+Comparison=' minimun' / , auth_doc . to_s )
265+ assert_match ( /<samlp:RequestedAuthnContext[\S ]+Comparison=" minimun" / , auth_doc . to_s )
265266 assert_match ( /<saml:AuthnContextClassRef>secure\/ name\/ password\/ uri<\/ saml:AuthnContextClassRef>/ , auth_doc . to_s )
266267 end
267268
268269 it "create the saml:AuthnContextDeclRef element correctly" do
269270 settings . authn_context_decl_ref = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
270271 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
271- assert_match ( /<saml:AuthnContextDeclRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<\/ saml:AuthnContextDeclRef>/ , auth_doc . to_s )
272+ assert_match ( /<saml:AuthnContextDeclRef>urn:oasis:names:tc:SAML:2\ . 0:ac:classes:PasswordProtectedTransport<\/ saml:AuthnContextDeclRef>/ , auth_doc . to_s )
272273 end
273274
274275 it "create the saml:AuthnContextClassRef element correctly" do
@@ -280,22 +281,22 @@ class AuthrequestTest < Minitest::Test
280281 it "create the saml:AuthnContextClassRef with comparison exact" do
281282 settings . authn_context = 'secure/name/password/uri'
282283 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
283- assert auth_doc . to_s =~ /<samlp:RequestedAuthnContext[\S ]+Comparison=' exact' /
284+ assert auth_doc . to_s =~ /<samlp:RequestedAuthnContext[\S ]+Comparison=" exact" /
284285 assert auth_doc . to_s =~ /<saml:AuthnContextClassRef>secure\/ name\/ password\/ uri<\/ saml:AuthnContextClassRef>/
285286 end
286287
287288 it "create the saml:AuthnContextClassRef with comparison minimun" do
288289 settings . authn_context = 'secure/name/password/uri'
289290 settings . authn_context_comparison = 'minimun'
290291 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
291- assert auth_doc . to_s =~ /<samlp:RequestedAuthnContext[\S ]+Comparison=' minimun' /
292+ assert auth_doc . to_s =~ /<samlp:RequestedAuthnContext[\S ]+Comparison=" minimun" /
292293 assert auth_doc . to_s =~ /<saml:AuthnContextClassRef>secure\/ name\/ password\/ uri<\/ saml:AuthnContextClassRef>/
293294 end
294295
295296 it "create the saml:AuthnContextDeclRef element correctly" do
296297 settings . authn_context_decl_ref = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
297298 auth_doc = RubySaml ::Authrequest . new . create_authentication_xml_doc ( settings )
298- assert auth_doc . to_s =~ /<saml:AuthnContextDeclRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<\/ saml:AuthnContextDeclRef>/
299+ assert auth_doc . to_s =~ /<saml:AuthnContextDeclRef>urn:oasis:names:tc:SAML:2\ . 0:ac:classes:PasswordProtectedTransport<\/ saml:AuthnContextDeclRef>/
299300 end
300301
301302 it "create multiple saml:AuthnContextDeclRef elements correctly " do
0 commit comments