Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created October 17, 2012 17:22
Show Gist options
  • Save enricostano/3906849 to your computer and use it in GitHub Desktop.
Save enricostano/3906849 to your computer and use it in GitHub Desktop.
describe "DELETE #destroy" do
before(:each) do
@institution = mock_model(Institution)
should_authorize(:destroy, @institution)
Institution.should_receive(:find).with("1").and_return(@institution)
@institution.should_receive(:destroy).and_return(true)
get :destroy, id: "1"
end
it "assigns the requested institution to @institution" do
assigns(:institution).should eq(@institution)
end
it "redirect to :index action" do
response.should redirect_to(institutions_url)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment