Skip to content

Instantly share code, notes, and snippets.

View lorenzorapetti's full-sized avatar

Lorenzo Rapetti lorenzorapetti

  • Rome, Italy
View GitHub Profile
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@lorenzorapetti
lorenzorapetti / .rubocop.yml
Last active April 5, 2017 14:53
Rubocop configuration
AllCops:
TargetRubyVersion: 2.4
TargetRailsVersion: 5.0.2
Rails:
Enabled: true
Lint/AmbiguousBlockAssociation:
Enabled: false
@lorenzorapetti
lorenzorapetti / .zshrc
Last active October 16, 2017 14:38
Zsh config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
source ~/.fonts/*.sh
# Path to your oh-my-zsh installation.
export ZSH=/Users/lorenzorapetti/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes