Skip to content

Instantly share code, notes, and snippets.

@celine-m-s
Last active March 7, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celine-m-s/5f6c2f2b961903fbee60bc6aad9243c9 to your computer and use it in GitHub Desktop.
Save celine-m-s/5f6c2f2b961903fbee60bc6aad9243c9 to your computer and use it in GitHub Desktop.
RSpec cheat sheet

Create a new objet and associate it to a new variable before each scenario or it.

let!(:message) { create(:message) } # if used with FactoryGirl, otherwise Message.create(params)

Check if objets have been created

expect { createsomething }.to change{Message.count}.by(20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment