On Sun, Feb 27, 2011 at 10:57 PM, Charley <[email protected]> wrote:
...
> it "redirects to the bugs list" do
> Bug.stub(:find) { mock_bug }
> delete :destroy, :id => "1"
> response.should redirect_to(bugs_url)
> end
>
> This fails for obvious reasons. A bug belongs to a project so the
> redirect should go to the projects_url("someproject_id_I_dont_know")
>
> I am sure this is a fairly simple and common thing. Can anyone help
> put me on the right path?
Make the mock_bug respond to project_id. Then verify that the request's
response goes to project_path(:id => mock_bug.project_id).
Regards,
Craig
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users