Created
February 4, 2013 14:10
-
-
Save johndel/4706913 to your computer and use it in GitHub Desktop.
Simple controller test
This file contains hidden or 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
... | |
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