开发者

Cucumber Test: Referring to a Rails Object Created by an Observer

开发者 https://www.devze.com 2023-01-31 07:55 出处:网络
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.

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,

  1. There is a Profile instance that is automatically created when a User instance is created.
  2. In Cucumber (and using Pickle), I create a User instance:
  3. The user_observer automatically creates a profile associated with "u_1"
  4. 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?


I would advice to use your own step definitions and create the stuff you need yourself.

Given the user "John Malkovich" has a resume pack
0

精彩评论

暂无评论...
验证码 换一张
取 消