Yes, Devise test helpers and all the other stuff. I have this code in controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
before_filter :authenticate_user!, force: true
User.omniauth_providers.each do |provider|
send :define_method, provider do
process_callback
end
end
private
def process_callback
process_callback should not be reached if the user is not logged in but it appears to be (in specs, I tried to investigate because I was having errors in staging due to not signed in users reaching the action although a before_filter is in place).
I tried to tinker around in helpers.rb in self.define_helpers where the method authenticate_#{mapping}! is created, the spec posted previously passes if I remove the if condition from warden.authenticate!(opts); tried swapping the conditions (ruby 1.9.3-p194) but obviously it sorted no effect.
I then tried to check if for some reason opts.delete(:force) was at fault but from a quick inspection it's okay.
I suspect there is more however, still investigating what's up.
Thanks!