Skip to content
Extraits de code Groupes Projets
Valider beeb02dc rédigé par danielgrippi's avatar danielgrippi
Parcourir les fichiers

omniauth 1.0 replaced 'user_info' with 'info'

parent d0f58e1b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -18,7 +18,7 @@ class ServicesController < ApplicationController ...@@ -18,7 +18,7 @@ class ServicesController < ApplicationController
secret = auth['credentials']['secret'] secret = auth['credentials']['secret']
provider = auth['provider'] provider = auth['provider']
user = auth['user_info'] user = auth['info']
service = "Services::#{provider.camelize}".constantize.new(:nickname => user['nickname'], service = "Services::#{provider.camelize}".constantize.new(:nickname => user['nickname'],
:access_token => toke, :access_token => toke,
......
...@@ -10,7 +10,7 @@ describe ServicesController do ...@@ -10,7 +10,7 @@ describe ServicesController do
let(:omniauth_auth) { let(:omniauth_auth) {
{ 'provider' => 'twitter', { 'provider' => 'twitter',
'uid' => '2', 'uid' => '2',
'user_info' => { 'nickname' => 'grimmin' }, 'info' => { 'nickname' => 'grimmin' },
'credentials' => { 'token' => 'tokin', 'secret' =>"not_so_much" } 'credentials' => { 'token' => 'tokin', 'secret' =>"not_so_much" }
} }
} }
...@@ -68,7 +68,7 @@ describe ServicesController do ...@@ -68,7 +68,7 @@ describe ServicesController do
it 'returns error if the service is connected with that uid' do it 'returns error if the service is connected with that uid' do
request.env['omniauth.auth'] = omniauth_auth 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_token => omniauth_auth['credentials']['token'],
:access_secret => omniauth_auth['credentials']['secret'], :access_secret => omniauth_auth['credentials']['secret'],
:uid => omniauth_auth['uid'], :uid => omniauth_auth['uid'],
...@@ -82,7 +82,7 @@ describe ServicesController do ...@@ -82,7 +82,7 @@ describe ServicesController do
context "photo fetching" do context "photo fetching" do
before do before do
omniauth_auth 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 request.env['omniauth.auth'] = omniauth_auth
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter