у меня есть определение шага огурца, которое не подхватывает объект.
ошибка:
| title | description |
| First Issue | This is a first issue. |
undefined method `issues' for nil:NilClass (NoMethodError)
./features/step_definitions/issue_steps.rb:3:in `block (2 levels) in <top (required)>'
Характеристика:
Background:
Given there is a release called "First Release"
And that release has a feature:
| title | description |
| Make it shiny! | Gradients! Starbursts! Oh my! |
And that feature has a issue:
| title | description |
| First Issue | This is a first issue. |
And I am on the homepage
Маршруты:
resources :releases do
resources :features
end
resources :features do
resources :issues
end
Определение шага:
Given /^that feature has a issue:$/ do |table|
table.hashes.each do |attributes|
@feature.issues.create!(attributes)
end
end
Определение шага: функция
Given /^that release has a feature:$/ do |table|
table.hashes.each do |attributes|
@release.features.create!(attributes)
end
end