1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Remove stuff deprecated on .rc2

This commit is contained in:
José Valim 2011-03-14 11:22:09 +01:00
parent 15d195d2f0
commit d58a72ee32
4 changed files with 1 additions and 69 deletions

View file

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
devise (1.2.rc) devise (1.2.rc2)
bcrypt-ruby (~> 2.1.2) bcrypt-ruby (~> 2.1.2)
orm_adapter (~> 0.0.3) orm_adapter (~> 0.0.3)
warden (~> 1.0.3) warden (~> 1.0.3)

View file

@ -13,18 +13,6 @@ module Devise
def strategy_class def strategy_class
::OmniAuth::Strategies.const_get("#{::OmniAuth::Utils.camelize(@provider.to_s)}") ::OmniAuth::Strategies.const_get("#{::OmniAuth::Utils.camelize(@provider.to_s)}")
end end
def check_if_allow_stubs!
raise "OmniAuth strategy for #{@provider} does not allow stubs, only OAuth2 ones do." unless allow_stubs?
end
def allow_stubs?
defined?(::OmniAuth::Strategies::OAuth2) && strategy.is_a?(::OmniAuth::Strategies::OAuth2)
end
def build_connection(&block)
strategy.client.connection.build(&block)
end
end end
end end
end end

View file

@ -1,31 +0,0 @@
module Devise
module OmniAuth
module TestHelpers
DEPRECATION_MESSAGE = "Faraday changed the way mocks work in a way incompatible to Devise. Luckily, Omniauth now supports a new test mode, please use it in your tests instead: https://github.com/intridea/omniauth/wiki/Integration-Testing"
DeprecationError = Class.new(StandardError)
def self.stub!(*args)
raise DeprecationError, DEPRECATION_MESSAGE
end
def self.reset_stubs!(*args)
raise DeprecationError, DEPRECATION_MESSAGE
end
def self.test_mode!
warn DEPRECATION_MESSAGE
end
def self.short_circuit_authorizers!
::OmniAuth.config.test_mode = true
warn DEPRECATION_MESSAGE
end
def self.unshort_circuit_authorizers!
::OmniAuth.config.test_mode = false
warn DEPRECATION_MESSAGE
end
end
end
end

View file

@ -1,25 +0,0 @@
require 'test_helper'
class OmniAuthTestHelpersTest < ActiveSupport::TestCase
test "Assert that stub! raises deprecation error" do
assert_raises Devise::OmniAuth::TestHelpers::DeprecationError do
Devise::OmniAuth::TestHelpers.stub!
end
end
test "Assert that reset_stubs! raises deprecation error" do
assert_raises Devise::OmniAuth::TestHelpers::DeprecationError do
Devise::OmniAuth::TestHelpers.reset_stubs!
end
end
test "Assert that short_circuit_authorizers! warns about deprecation" do
Devise::OmniAuth::TestHelpers.short_circuit_authorizers!
assert ::OmniAuth.config.test_mode
end
test "Assert that unshort_circuit_authorizers! warns about deprecation" do
Devise::OmniAuth::TestHelpers.unshort_circuit_authorizers!
assert ! ::OmniAuth.config.test_mode
end
end