Skip to content

Instantly share code, notes, and snippets.

@mickey
Created November 19, 2009 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickey/239110 to your computer and use it in GitHub Desktop.
Save mickey/239110 to your computer and use it in GitHub Desktop.
def logged_as(user)
proxy = Warden::Proxy.new(request.env, {:default_strategies => [:rememberable, :authenticable], :silence_missing_strategies => true})
proxy.set_user(user, :store => true, :scope => :user)
request.env['warden'] = proxy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment