Fix the issue in the ROR tutorial's chapter 9

I have caught a issue like this: web

:Failure/Error: expect { click_link('delete') }.to change(User, :count).by(-1)  ActiveRecord::RecordNotFound: this

And also I try to delete the user in the web,but also I failed,so how to fix it? flash

At the end,I found that my destroy method wrong,it should be same to this: it

def destroy
    User.find(params[:id]).destroy
    flash[:success] = "User destroyed."
    redirect_to users_path
 end cli

So fix it now! di

6/26/2013 co

Blues let

相關文章
相關標籤/搜索