Remove stuff deprecated on .rc2
This commit is contained in:
parent
15d195d2f0
commit
d58a72ee32
|
@ -1,7 +1,7 @@
|
|||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
devise (1.2.rc)
|
||||
devise (1.2.rc2)
|
||||
bcrypt-ruby (~> 2.1.2)
|
||||
orm_adapter (~> 0.0.3)
|
||||
warden (~> 1.0.3)
|
||||
|
|
|
@ -13,18 +13,6 @@ module Devise
|
|||
def strategy_class
|
||||
::OmniAuth::Strategies.const_get("#{::OmniAuth::Utils.camelize(@provider.to_s)}")
|
||||
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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue