File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 127127
128128 context "when the response is valid" do
129129 it "should set the uid to the nameID in the SAML response" do
130- subject
130+ post_callback_response
131+
131132 expect ( auth_hash [ 'uid' ] ) . to eq '_1f6fcf6be5e13b08b1e3610e7ff59f205fbd814f23'
132133 end
133134
134135 it "should set the raw info to all attributes" do
135- subject
136+ post_callback_response
137+
136138 expect ( auth_hash [ 'extra' ] [ 'raw_info' ] . all . to_hash ) . to eq (
137139 'first_name' => [ 'Rajiv' ] ,
138140 'last_name' => [ 'Manglani' ] ,
143145 end
144146
145147 it "should set the response_object to the response object from ruby_saml response" do
146- subject
148+ post_callback_response
149+
147150 expect ( auth_hash [ 'extra' ] [ 'response_object' ] ) . to be_kind_of ( OneLogin ::RubySaml ::Response )
148151 end
149152 end
224227 last_name : [ "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" ]
225228 }
226229
227- subject
230+ post_callback_response
228231 end
229232
230233 it "should obey attribute statements mapping" do
243246 before :each do
244247 saml_options [ :idp_cert_fingerprint ] = "3B:82:F1:F5:54:FC:A8:FF:12:B8:4B:B8:16:61:1D:E4:8E:9B:E2:3C"
245248 saml_options [ :uid_attribute ] = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
246- subject
249+
250+ post_callback_response
247251 end
248252
249253 it "should return user id attribute" do
257261 end
258262
259263 it "should fail to authenticate" do
260- expect ( subject ) . to fail_with ( :invalid_ticket )
264+ expect ( post_callback_response ) . to fail_with ( :invalid_ticket )
261265 expect ( last_request . env [ 'omniauth.error' ] ) . to be_instance_of ( OmniAuth ::Strategies ::SAML ::ValidationError )
262266 expect ( last_request . env [ 'omniauth.error' ] . message ) . to eq ( "SAML response missing 'missing_attribute' attribute" )
263267 end
You can’t perform that action at this time.
0 commit comments