我目前正在进行铁路项目,我在测试我的规格时遇到了这个错误。
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)>'
答案 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)