@@ -174,16 +174,20 @@ def test_request_phase_via_http
174174 def test_option_acr_values
175175 strategy . options . client_options [ :host ] = 'foobar.com'
176176
177- refute_match /acr_values=/ , strategy . authorize_uri , 'URI must not contain acr_values' #/
177+ refute_includes strategy . authorize_params . keys , :acr_values ,
178+ 'URI must not contain acr_values' #/
178179
179180 strategy . options . acr_values = 'urn:some:acr:values:value'
180- assert_match /acr_values=/ , strategy . authorize_uri , 'URI must contain acr_values'
181+ assert_includes strategy . authorize_params . keys , :acr_values ,
182+ 'URI must contain acr_values'
181183 end
182184
185+
183186 def test_option_custom_attributes
184187 strategy . options . client_options [ :host ] = 'foobar.com'
185188 strategy . options . extra_authorize_params = { resource : 'xyz' }
186- assert_match /resource=xyz/ , strategy . authorize_uri , 'URI must contain custom params'
189+ assert_match 'xyz' , strategy . authorize_params [ :resource ] ,
190+ 'URI must contain custom params'
187191 end
188192
189193
@@ -428,11 +432,10 @@ def test_callback_phase_with_invalid_state
428432
429433 strategy . call! ( 'rack.session' => { 'omniauth.state' => state ,
430434 'omniauth.nonce' => nonce } )
435+ strategy . expects ( :fail! )
431436 result = strategy . callback_phase
432437 assert_kind_of Array , result
433438 assert_equal 302 , result . first , 'Expecting redirect to /callback/failure'
434-
435- strategy . expects ( :fail! )
436439 end
437440
438441 def test_callback_phase_without_code
@@ -687,7 +690,8 @@ def test_state
687690 def test_dynamic_state
688691 # Stub request parameters
689692 request . stubs ( :path_info ) . returns ( '' )
690- strategy . call! ( 'rack.session' => { } , QUERY_STRING : { state : 'abc' , client_id : '123' } )
693+ strategy . call! ( 'rack.session' => { } ,
694+ Rack ::QUERY_STRING => { state : 'abc' , client_id : '123' } )
691695
692696 assert_kind_of Array , result
693697 assert_equal 302 , result . first , 'Expecting redirect to /auth/failure'
0 commit comments