From beeb02dcd68a7a24ad173ab60b9a2ad7f6a767c0 Mon Sep 17 00:00:00 2001
From: danielgrippi <danielgrippi@gmail.com>
Date: Tue, 6 Dec 2011 17:53:41 -0800
Subject: [PATCH] omniauth 1.0 replaced 'user_info' with 'info'

---
 app/controllers/services_controller.rb       | 2 +-
 spec/controllers/services_controller_spec.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 0ccb00bb80..8dee8d961b 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -18,7 +18,7 @@ class ServicesController < ApplicationController
     secret = auth['credentials']['secret']
 
     provider = auth['provider']
-    user     = auth['user_info']
+    user     = auth['info']
 
     service = "Services::#{provider.camelize}".constantize.new(:nickname => user['nickname'],
                                                                :access_token => toke,
diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb
index e361ab8c76..cb0fe3b901 100644
--- a/spec/controllers/services_controller_spec.rb
+++ b/spec/controllers/services_controller_spec.rb
@@ -10,7 +10,7 @@ describe ServicesController do
   let(:omniauth_auth) {
     { 'provider' => 'twitter',
       'uid'      => '2',
-      'user_info'   => { 'nickname' => 'grimmin' },
+      'info'   => { 'nickname' => 'grimmin' },
       'credentials' => { 'token' => 'tokin', 'secret' =>"not_so_much" }
       }
   }
@@ -68,7 +68,7 @@ describe ServicesController do
     it 'returns error if the service is connected with that uid' do
       request.env['omniauth.auth'] = omniauth_auth
 
-      Services::Twitter.create!(:nickname => omniauth_auth["user_info"]['nickname'],
+      Services::Twitter.create!(:nickname => omniauth_auth["info"]['nickname'],
                                            :access_token => omniauth_auth['credentials']['token'],
                                            :access_secret => omniauth_auth['credentials']['secret'],
                                            :uid => omniauth_auth['uid'],
@@ -82,7 +82,7 @@ describe ServicesController do
     context "photo fetching" do
       before do
         omniauth_auth
-        omniauth_auth["user_info"].merge!({"image" => "https://service.com/fallback_lowres.jpg"})
+        omniauth_auth["info"].merge!({"image" => "https://service.com/fallback_lowres.jpg"})
 
         request.env['omniauth.auth'] = omniauth_auth
       end
-- 
GitLab