Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Created May 8, 2013 18:05
Show Gist options
  • Save the-teacher/5542290 to your computer and use it in GitHub Desktop.
Save the-teacher/5542290 to your computer and use it in GitHub Desktop.
RSpec note
# STUB draft
Page.any_instance.stub(:save).and_return(false)
# CREATE draft
page = Page.create! valid_attributes
expect {
delete :destroy, {:id => page.to_param}, valid_session
}.to change(Page, :count).by(-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment