Skip to content

Instantly share code, notes, and snippets.

Jimmy Lo jimmylorunning

Block or report user

Report or block jimmylorunning

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jimmylorunning
jimmylorunning / .vimrc
Last active Aug 29, 2015
.vimrc tab settings
View .vimrc
set smartindent
set tabstop=2
set shiftwidth=2
set expandtab
@jimmylorunning
jimmylorunning / controller_helpers.rb
Created Jan 5, 2015
stubbing devise authentication
View controller_helpers.rb
module ControllerHelpers
def sign_in(user = double('user'))
if user.nil?
allow(request.env['warden']).to receive(:authenticate!).and_throw(:warden, {:scope => :user})
allow(controller).to receive(:current_user).and_return(nil)
else
allow(request.env['warden']).to receive(:authenticate!).and_return(user)
allow(controller).to receive(:current_user).and_return(user)
end
end
You can’t perform that action at this time.