Cucumber 测试:引用观察者创建的 Rails 对象
我有一个黄瓜测试,它需要引用观察者创建的对象,我想知道是否有办法做到这一点。
具体来说,
- 创建 User 实例时会自动创建一个 Profile 实例。
- 在 Cucumber(并使用 Pickle)中,我创建一个 User 实例:
- user_observer 自动创建与“u_1”关联的配置文件
- ,并且我想在不同的场景中引用该配置文件。
例如。
Given the following users exist:
| user | first_name | last_name |
| test | john | malkovich |
And the following resume_packs exist:
| profile | page | pack_name |
| test.profile | 2 | who's who |
test.profile 是一个空格填充符,那么引用 test.profile 的实际方法是什么?
I have a cucumber test, which needs to refer to an object that is created by an observer and am wondering if there is a way to do that.
Specifically,
- There is a Profile instance that is automatically created when a User instance is created.
- In Cucumber (and using Pickle), I create a User instance:
- The user_observer automatically creates a profile associated with "u_1"
- And I want to refer to the Profile in a different scenario.
For example.
Given the following users exist:
| user | first_name | last_name |
| test | john | malkovich |
And the following resume_packs exist:
| profile | page | pack_name |
| test.profile | 2 | who's who |
test.profile is a space filler, so what is the actual way to refer to test.profile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用您自己的步骤定义并自己创建您需要的东西。
I would advice to use your own step definitions and create the stuff you need yourself.