Я пытаюсь привыкнуть к 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