mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Update dependencies for OmniAuth 1.0.0 stable
This commit is contained in:
parent
ea9e8c0c9b
commit
2a29e87eb9
4 changed files with 15 additions and 15 deletions
7
Gemfile
7
Gemfile
|
@ -3,13 +3,14 @@ source "http://rubygems.org"
|
|||
gemspec
|
||||
|
||||
gem "rails", "~> 3.1.0"
|
||||
gem 'omniauth', '~> 1.0.0.pr2'
|
||||
gem 'omniauth-contrib', :git => 'http://github.com/intridea/omniauth-contrib.git' #'~> 1.0.0.pr2'
|
||||
gem 'omniauth-oauth2'
|
||||
gem 'omniauth', '~> 1.0.0'
|
||||
gem 'omniauth-oauth2', '~> 1.0.0'
|
||||
|
||||
gem "rdoc"
|
||||
|
||||
group :test do
|
||||
gem 'omniauth-facebook'
|
||||
gem 'omniauth-openid', '~> 1.0.1'
|
||||
gem "webrat", "0.7.2", :require => false
|
||||
gem "mocha", :require => false
|
||||
end
|
||||
|
|
|
@ -40,13 +40,13 @@ class OmniAuthRoutesTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
test 'should generate authorization path with params' do
|
||||
assert_match "/users/auth/open_id?openid_url=http%3A%2F%2Fyahoo.com",
|
||||
@controller.omniauth_authorize_path(:user, :open_id, :openid_url => "http://yahoo.com")
|
||||
assert_match "/users/auth/openid?openid_url=http%3A%2F%2Fyahoo.com",
|
||||
@controller.omniauth_authorize_path(:user, :openid, :openid_url => "http://yahoo.com")
|
||||
end
|
||||
|
||||
test 'should not add a "?" if no param was sent' do
|
||||
assert_equal "/users/auth/open_id",
|
||||
@controller.omniauth_authorize_path(:user, :open_id)
|
||||
assert_equal "/users/auth/openid",
|
||||
@controller.omniauth_authorize_path(:user, :openid)
|
||||
end
|
||||
|
||||
test 'should set script name in the path if present' do
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require 'omniauth-contrib'
|
||||
|
||||
# Use this hook to configure devise mailer, warden hooks and so forth. The first
|
||||
# four configuration values can also be set straight in your models.
|
||||
Devise.setup do |config|
|
||||
|
@ -178,8 +176,9 @@ Devise.setup do |config|
|
|||
# config.sign_out_via = :get
|
||||
|
||||
# ==> OmniAuth
|
||||
config.omniauth :facebook, 'APP_ID', 'APP_SECRET'
|
||||
config.omniauth :facebook, 'APP_ID', 'APP_SECRET', :name => 'other_facebook'
|
||||
config.omniauth :facebook, 'APP_ID', 'APP_SECRET', :scope => 'email,offline_access'
|
||||
config.omniauth :openid
|
||||
config.omniauth :openid, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
|
|
|
@ -96,10 +96,10 @@ class DefaultRoutingTest < ActionController::TestCase
|
|||
assert_recognizes({:controller => 'users/omniauth_callbacks', :action => 'facebook'}, {:path => 'users/auth/facebook/callback', :method => :post})
|
||||
assert_named_route "/users/auth/facebook/callback", :user_omniauth_callback_path, :facebook
|
||||
|
||||
# named strategy
|
||||
assert_recognizes({:controller => 'users/omniauth_callbacks', :action => 'other_facebook'}, {:path => 'users/auth/other_facebook/callback', :method => :get})
|
||||
assert_recognizes({:controller => 'users/omniauth_callbacks', :action => 'other_facebook'}, {:path => 'users/auth/other_facebook/callback', :method => :post})
|
||||
assert_named_route "/users/auth/other_facebook/callback", :user_omniauth_callback_path, :other_facebook
|
||||
# named open_id
|
||||
assert_recognizes({:controller => 'users/omniauth_callbacks', :action => 'google'}, {:path => 'users/auth/google/callback', :method => :get})
|
||||
assert_recognizes({:controller => 'users/omniauth_callbacks', :action => 'google'}, {:path => 'users/auth/google/callback', :method => :post})
|
||||
assert_named_route "/users/auth/google/callback", :user_omniauth_callback_path, :google
|
||||
|
||||
assert_raise ActionController::RoutingError do
|
||||
assert_recognizes({:controller => 'ysers/omniauth_callbacks', :action => 'twitter'}, {:path => 'users/auth/twitter/callback', :method => :get})
|
||||
|
|
Loading…
Reference in a new issue