avoid comparing ids directly for Authlogic internal stuff

some plugins might change how authlogic works, but we'll still be
able to find the Pseudonym itself

Change-Id: Ib88d583a124d47249555cae12610684c3abecc69
Reviewed-on: https://gerrit.instructure.com/5863
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
This commit is contained in:
Cody Cutrer 2011-09-27 13:12:24 -06:00
parent e749446e90
commit 51d48f874b
1 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ describe PseudonymSessionsController do
get 'saml_consume', :SAMLResponse => "foo"
response.should redirect_to(dashboard_url(:login_success => 1))
session[:name_id].should == unique_id
session[:pseudonym_credentials_id].should == user1.pseudonyms.first.id
Pseudonym.find(session[:pseudonym_credentials_id]).should == user1.pseudonyms.first
(controller.instance_variables.grep(/@[^_]/) - ['@mock_proxy']).each{ |var| controller.send :remove_instance_variable, var }
session.reset
@ -52,7 +52,7 @@ describe PseudonymSessionsController do
get 'saml_consume', :SAMLResponse => "bar"
response.should redirect_to(dashboard_url(:login_success => 1))
session[:name_id].should == unique_id
session[:pseudonym_credentials_id].should == user2.pseudonyms.first.id
Pseudonym.find(session[:pseudonym_credentials_id]).should == user2.pseudonyms.first
Setting.set_config("saml", nil)
end
@ -84,7 +84,7 @@ describe PseudonymSessionsController do
get 'new', :ticket => 'ST-abcd'
response.should redirect_to(dashboard_url(:login_success => 1))
session[:cas_login].should == true
session[:pseudonym_credentials_id].should == user1.pseudonyms.first.id
Pseudonym.find(session[:pseudonym_credentials_id]).should == user1.pseudonyms.first
(controller.instance_variables.grep(/@[^_]/) - ['@mock_proxy']).each{ |var| controller.send :remove_instance_variable, var }
session.reset
@ -93,7 +93,7 @@ describe PseudonymSessionsController do
get 'new', :ticket => 'ST-efgh'
response.should redirect_to(dashboard_url(:login_success => 1))
session[:cas_login].should == true
session[:pseudonym_credentials_id].should == user2.pseudonyms.first.id
Pseudonym.find(session[:pseudonym_credentials_id]).should == user2.pseudonyms.first
end
it "should log in and log out a user CAS has validated" do