1
我有问题:在我看来无法找到链接(水豚:: ElementNotFound)
find_movies_with_same_director_movie GET /movies/:id/find_movies_with_same_director(.:format) {:action=>"find_movies_with_same_director", :controller=>"movies"}
movies GET /movies(.:format)
:
When I follow "Find Movies With Same Director" #
features/step_definitions/web_steps.rb:56
Unable to find link "Find Movies With Same Director" (Capybara::ElementNotFound)
在web_steps.rb:
When /^(?:|I)follow "([^"]*)"$/ do |link|
click_link(link)
end
在我的路线
show.html.haml:
%br
= link_to 'Find Movies With Same Director', find_movies_with_same_director_movie_path(@movie)
在控制器movies_controller.rb:
def find_movies_with_same_director
# some code
end
错了呢?
当您点击此链接时,您是否在正确的页面上? – sevenseacat 2013-02-21 11:05:55
'代码'场景:找同样导演的电影 由于我在“星球大战”的详细信息页面 当我按照“找到与相同导演的电影”代码“ – kotygoroshko 2013-02-21 12:14:26
,不回答问题。在失败步骤之前使用'save_and_open_page'确保您位于正确的页面上。 – sevenseacat 2013-02-21 12:15:19