不知道从哪里开始调试此错误

时间:2016-02-16 21:06:07

标签: ruby-on-rails-4

我目前正在进行铁路项目,我在测试我的规格时遇到了这个错误。

 h1) Deleting todo items is successful
 Failure/Error: click_link "Delete"
 ActionController::RoutingError:
   No route matches [DELETE] "/todo_lists/1/todo_items/1/edit"
 # ./spec/features/todo_items/delete_spec.rb:17:in `block (3 levels) in <top (required)>'
 # ./spec/features/todo_items/delete_spec.rb:16:in `block (2 levels) in <top (required)>'

1 个答案:

答案 0 :(得分:0)

运行您的rake routes并检查您拥有的路线。很可能没有DELETE/todo_lists/1/todo_items/1/edit可用(并且应该有一个)。

DELETE应该是/todo_lists/1/todo_items/1网址

的问题

修改:在您的https://github.com/amidabrian51/odot/blob/master/app/views/todo_items/index.html.erb#L8中应该是todo_list_todo_item_path(todo_item)