public
Created

  • Download Gist
stub_omniauth.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Around('@stub_facebook') do |scenario, block|
class OmniAuth::Builder
alias_method :orig_call, :call
def call(env)
TestOmniAuth.new(@app).call(env)
end
end
 
#for some reason this doesn't work
Rails.application.config.middleware.swap OmniAuth::Builder, TestOmniAuth
block.call
 
class OmniAuth::Builder
alias_method :call, :orig_call
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.