Created
May 8, 2013 18:05
-
-
Save the-teacher/5542290 to your computer and use it in GitHub Desktop.
RSpec note
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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