오이와 BDD에 익숙해 지려고 노력 중입니다. 몇 가지 기능을 이미 작성했는데, 특히 혼란 스럽습니다. 여기에 오류 :Cucumber와 함께이 오류를 알아낼 수 없습니다. "매핑을 찾을 수 없습니다."
Scenario: # features/viewing_posts.feature:6
Given there is a post with the title "Just another day at the beach" # features/step_definitions/post_steps.rb:1
And I am on the homepage # features/step_definitions/web_steps.rb:44
When I follow "Just another day at the beach" # features/step_definitions/web_steps.rb:56
Then I should be on the post page for "Just another day at the beach" # features/step_definitions/web_steps.rb:230
Can't find mapping from "the post page for "Just another day at the beach"" to a path.
Now, go and add a mapping in /Users/jeff/rails_projects/jeffc/features/support/paths.rb (RuntimeError)
./features/support/paths.rb:29:in `rescue in path_to'
./features/support/paths.rb:23:in `path_to'
./features/step_definitions/web_steps.rb:233:in `/^(?:|I)should be on (.+)$/'
features/viewing_posts.feature:10:in `Then I should be on the post page for "Just another day at the beach"'
Failing Scenarios:
cucumber features/viewing_posts.feature:6 # Scenario:
해당 오류에서 web_steps.rb를 검사했는데 일치해야하는 단계가 있습니다.
Then /^(?:|I)should be on (.+)$/ do |page_name|
current_path = URI.parse(current_url).path
if current_path.respond_to? :should
current_path.should == path_to(page_name)
else
assert_equal path_to(page_name), current_path
end
end
그것은까지 통과 년대 "그럼 난 후 페이지 ...에 있어야합니다"
사람이 함께 무슨 일이 일어나고 있는지 제안 할 수 있습니까?
감사
J는
path.rb에서 무엇을해야합니까? – Aravin
@Aravin 아무것도, 그냥 그대로 둘 수 있어야합니다. 문제가 있습니까? – JeffC