1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/omniauth/test_helpers.rb
Vinicius Baggio 352edc024b Cleaning up test helpers related to OmniAuth.
Developers should rely on OmniAuth's new testing API. Check
https://github.com/intridea/omniauth/wiki/Integration-Testing
for more details.
2011-02-24 16:50:22 -03:00

31 lines
889 B
Ruby

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