@@ -433,19 +433,19 @@ def make_env(path = "/auth/ldap", props = {})
433433 expect ( info . description ) . to eq "omniauth-ldap"
434434 end
435435
436- context 'and mapping is set' do
436+ context "when mapping is set" do
437437 let ( :app ) do
438438 Rack ::Builder . new {
439439 use OmniAuth ::Test ::PhonySession
440- use MyLdapProvider , : name => ' ldap' , : host => ' 192.168.1.145' , : base => ' dc=score, dc=local' , : mapping => { ' phone' => ' mobile' }
441- run lambda { |env | [ 404 , { ' Content-Type' => ' text/plain' } , [ env . key? ( ' omniauth.auth' ) . to_s ] ] }
440+ use MyLdapProvider , name : " ldap" , host : " 192.168.1.145" , base : " dc=score, dc=local" , mapping : { " phone" => " mobile" }
441+ run lambda { |env | [ 404 , { " Content-Type" => " text/plain" } , [ env . key? ( " omniauth.auth" ) . to_s ] ] }
442442 } . to_app
443443 end
444444
445- it 'should map user info according to customized mapping' do
446- post ( ' /auth/ldap/callback' , { : username => ' ping' , : password => ' password' } )
447- expect ( auth_hash . info . phone ) . to eq ' 444-444-4444'
448- expect ( auth_hash . info . mobile ) . to eq ' 444-444-4444'
445+ it "maps user info according to customized mapping" do
446+ post ( " /auth/ldap/callback" , { username : " ping" , password : " password" } )
447+ expect ( auth_hash . info . phone ) . to eq " 444-444-4444"
448+ expect ( auth_hash . info . mobile ) . to eq " 444-444-4444"
449449 end
450450 end
451451 end
@@ -646,7 +646,7 @@ def connection_returning(entry)
646646 header_auth : true ,
647647 header_name : "REMOTE_USER" ,
648648 name_proc : proc { |n | n } ,
649- mapping : { "phone" => "mobile" }
649+ mapping : { "phone" => "mobile" }
650650 run lambda { |env | [ 404 , { "Content-Type" => "text/plain" } , [ env . key? ( "omniauth.auth" ) . to_s ] ] }
651651 end . to_app
652652 end
0 commit comments