*在底部更新*当寻找不存在的用户时,我得到:Mongoid::Errors::DocumentNotFoundinUsersController#showProblem:Document(s)notfoundforclassUserwithid(s)22.Summary:WhencallingUser.findwithanidorarrayofids,eachparametermustmatchadocumentinthedatabaseorthiserrorwillberaised.Thesearchwasfortheid(s):22...(1total)andthefollowin
我有一个带有以下代码的ArticleController:defedit@article=current_user.articles.find(params[:id])end以及以下测试:describe"GET'edit'"doit"shouldfailwhensignedinandeditinganotheruserarticle"dosign_in@userget:edit,:id=>@another_user_article.idresponse.should_notbe_successendend但是,当我开始测试时,出现以下错误(这是正常的),但我想知道如何处理才能让我的测
虽然我有ID为13163的记录(db.locations.find({_id:13163})),但它给我错误:Mongoid::Errors::DocumentNotFoundinLocationsController#showProblem:Document(s)notfoundforclassLocationwithid(s)13163.Summary:WhencallingLocation.findwithanidorarrayofids,eachparametermustmatchadocumentinthedatabaseorthiserrorwillberaised.The