【发布时间】:2012-02-11 17:22:58
【问题描述】:
我正在描述随机绘图的行为。为此,我想写一个这样的场景:
Scenario: Request a drawing
Given a drawing list has been created
And there is a drawing code for today
And no emails have been sent
Then "abc@domain.com" should have no emails
And "def@domain.com" should have no emails
When I go to the drawing page
Then I should see "Special Drawing"
And the title should be "Special Drawing"
And I fill in the following:
|Promotion code |#{@drawings.code}|
最后一行是我很模糊的那一行。我有一个步骤可以创建一个使@drawings.code 成为有效表达式的ivar,但我只是随机将插值语法放在那里以说明我喜欢 做什么。
关键是,我不知道代码,直到执行第二个 Given 才确定。检索它的最佳方法是什么?
谢谢
- 导轨 (3.0.3)
- 黄瓜 (0.10.0)
- 黄瓜导轨 (0.3.2)
- 水豚 (0.4.0)
【问题讨论】:
-
您是否尝试将表视为 first-col = name, second-col = value?或者单行下面会有其他值吗?