Я новичок в Ruby.Я пытаюсь выяснить, как написать вложенную инструкцию case.Вот пример того, что я пытаюсь сделать:
# cucumber, webrat paths.rb
def path_to(page_name)
case page_name
when /the "?(.*)"? event registration homepage/ then
case $1
when '2011 CIO GL Global' then '/event/index/id/236'
when '2011 CIO IS Chicago' then '/event/index/id/275'
when '2011 CIO ES Denver' then '/event/index/id/217'
when '2011 CIO ES Vancouver, BC' then '/event/index/id/234'
else
raise "Can't find mapping for \"#{$1}\" to a path.\n" +
"Now, go and add a mapping in #{__FILE__}"
end
when /the contact match verification page/
'/attendee/user-verification'
end
end
В моем файле возможностей написано:
When I go to the "2011 CIO IS Chicago" event registration homepage
На этом шаге происходит сбой, поскольку он вызывает исключение, упомянутое выше,хотя я определил это в моем изложении выше.Что я делаю не так?