Skip to content

Instantly share code, notes, and snippets.

@radar
Last active January 14, 2016 00:05
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 radar/e20e3643d8627b21a4df to your computer and use it in GitHub Desktop.
Save radar/e20e3643d8627b21a4df to your computer and use it in GitHub Desktop.
module UserHelpers
def new_user
user = Fabricate(:user)
session[:user_id] = user.id
end
def current_user
User.find(session[:user_id])
end
def clear_current_user
session[:user_id] = nil
end
end
RSpec.configure { |c| c.include(UserHelpers) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment