我有这样一个功能的场景
Scenario: can't find similar movies if we don't know director (sad path)
Given I am on the details page for "Alien"
Then I should not see "Ridley Scott"
When I follow "Find Movies With Same Director"
Then I should be on the home page
Then I should see "'Alien' has no director info"
我有一个名为 find_by_same_director 的“查找具有相同导演的电影”的控制器操作,并且还有一个同名的视图模板,但是当电影没有导演时,类似的电影应该带到主页,我在控制器操作中执行这样..
def find_by_same_director
m = Movie.find params[:id]
@similar_movies = m.similar_movies
if @similar_movies.count == 0
flash[:notice] = "#{m.title} has no director info"
render :index
end
end
而在paths.rb path_to 方法有'主页'的情况是这样的
when /^the home\s?page$/
movies_path
通过这一步然后我应该在主页上我应该做什么?谢谢