Sha256: 16ee7baf09efc2394c9df5dd63e5e712f1720142031f9be05788a89a532d7446
Contents?: true
Size: 441 Bytes
Versions: 10
Compression:
Stored size: 441 Bytes
Contents
module ControllerHelpers def sign_in(user = instance_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 end
Version data entries
10 entries across 10 versions & 1 rubygems