describe "the destroy action" do before :each do @<%= singular_name %> = mock_record <%= class_name %>, :destroy => true end context "in html format" do before :each do delete :destroy, :id => @<%= singular_name %>.to_param end it { should respond_with(:redirect) } it { should redirect_to(<%= plural_name %>_url) } it { should assign_to(:<%= singular_name %>).with(@<%= singular_name %>) } it { should_not set_the_flash } end context "in xml format" do before :each do delete :destroy, :id => @<%= singular_name %>.to_param, :format => "xml" end it { should respond_with_content_type(:xml) } it { should respond_with(:ok) } it { should assign_to(:<%= singular_name %>).with(@<%= singular_name %>) } end end