Skip to content

Instantly share code, notes, and snippets.

View cdale77's full-sized avatar

Brad Johnson cdale77

View GitHub Profile
@cdale77
cdale77 / rspec_rails_cheetsheet.rb
Created May 12, 2016 18:50 — forked from them0nk/rspec_rails_cheetsheet.rb
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)