Last active
January 14, 2016 00:05
-
-
Save radar/e20e3643d8627b21a4df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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