我有一个失败的步骤定义。
从下面的功能中,我发现它在“并且该功能有问题”时失败(标题处未定义的局部变量)
Feature: Viewing issue
In order to view the issues for a feature
As a user
I want to see them on that feature's page
Background:
Given there is a release called "Confluence"
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
Scenario: Viewing issue for a given feature
When I follow "Confluence"
Then I should see "Standards compliance"
When I follow "Standards compliance"
Then I should see "First Issue"
And I should see "This is a first issue."
我如何为它写一个步骤定义。
这就是我对功能定义所拥有的,它工作得很好,但我尝试对问题对象做同样的事情,但它不起作用
Given /^that release has a feature:$/ do |table|
table.hashes.each do |attributes|
@release.features.create!(attributes)
end
end