it "update action should render edit template when model is invalid" do <%= singular_name %> = Factory(:<%= singular_name %>) ActiveRecord::Errors.any_instance.stubs(:empty?).returns(false) put :update, :id => <%= singular_name %> response.should render_template(:edit) end it "update action should redirect when model is valid" do ActiveRecord::Errors.any_instance.stubs(:empty?).returns(true) put :update, :id => Factory(:<%= singular_name %>) response.should redirect_to(<%= item_path_for_spec('url') %>) end