Permalink
Browse files

Password strategy was disregarding the :identifier_key

  • Loading branch information...
1 parent fdd92db commit 5e3c5d4ebd1c72e30e2f35ecf558f2ab8d080b50 @AndrewO AndrewO committed Jan 22, 2011
@@ -7,9 +7,8 @@ class Password
include OmniAuth::Strategy
def initialize(app, secret = 'changethisappsecret', options = {}, &block)
- @options = options
@secret = secret
- super(app, :password, &block)
+ super(app, :password, options, &block)
end
attr_reader :secret
@@ -22,6 +22,11 @@ def sets_uid_to(uid)
end
end
+ def sets_user_info_to(user_info)
+ it "should set the user_info to #{user_info}" do
+ (last_request.env['omniauth.auth'] || {})['user_info'].should == user_info
+ end
+ end
end
end
@@ -27,6 +27,7 @@ def strategy
end
sets_an_auth_hash
sets_provider_to 'password'
+ sets_user_info_to "username" => "jerome"
it 'should set the UID to an opaque identifier' do
uid = last_request.env['omniauth.auth']['uid']
uid.should_not be_nil

0 comments on commit 5e3c5d4

Please sign in to comment.