Ruby on rails Cucumber/Capybara表中的变量
我在描述一幅随机画的行为。为此,我想写一个这样的场景:Ruby on rails Cucumber/Capybara表中的变量,ruby-on-rails,cucumber,Ruby On Rails,Cucumber,我在描述一幅随机画的行为。为此,我想写一个这样的场景: 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
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}|
最后一行是我不清楚的那一行。我有一个步骤可以创建一个ivar,使@drawings.code
成为一个有效的表达式,但我只是随机将插值语法放在其中,以说明我想做什么
关键是,我不知道代码,直到第二个给定的代码被执行,它才被确定。检索它的最佳方式是什么
谢谢
- 轨道(3.0.3)
- 黄瓜(0.10.0)
- 黄瓜轨(0.3.2)
- 水豚(0.4.0)