最新にしたらpaths.rbとBackgroundが追加されていたのでメモ。
###features/support/paths.rb
Cucumberを最新にしてfeatureをgenerateしようとしたらpaths.rbがないと怒られたので、script/generate cucumberでpaths.rbファイルを生成しました。
Scenarioで記述するページはここで定義:
rails>>
#features/support/paths.rb
module NavigationHelpers
def path_to(page_name)
case page_name
when /the homepage/
root_path
<<--
###Background
1feature内のScenarioに共通な前提条件を記述する。
Backgroundで書かれた条件は、各Scenario実行前、かつBefore Hookの後に実行されるようです。
The background is run before each of your scenarios but after any of your Before Hooks.
http://wiki.github.com/aslakhellesoy/cucumber/background
rails>>
Background:
Given a global administrator named “Greg”
And a blog named “Greg’s anti-tax rants”
And a customer named “Dr. Bill”
And a blog named “Expensive Therapy” owned by “Dr. Bill”
<<--