Aslak Hellesoyによる補助輪の投稿で、彼は、より最近のバージョンのキュウリからweb_steps.rbとpaths.rbを削除したと述べています。
web_steps.rbの代わりにCapybaraAPIを使用することは理解できますが、特定のページにいることをどのようにテストしますか?
これは私がpaths.rbでそれを行っていた方法です:
#admin_authentication.feature
Then I should be on the admin home page
# paths.rb
when /the admin home page/
admin_root_path
# 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
二次的な質問として、これを行うべきでしょうか?