Skip to content

Instantly share code, notes, and snippets.

@johndel
Created February 4, 2013 14:10
Show Gist options
  • Save johndel/4706913 to your computer and use it in GitHub Desktop.
Save johndel/4706913 to your computer and use it in GitHub Desktop.
Simple controller test
...
describe "GET 'delete'" do
before :each do
@upload = create(:upload)
end
it "deletes the upload" do
expect{
delete :destroy, id: @upload
}.to change(Upload, :count).by(-1)
end
it "redirects to upload#index" do
delete :destroy, id: @upload
response.should redirect_to admin_uploads_url
end
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment