我是 Rails 和 Cucumber 的新手,我正在尝试测试以下场景
Background:
Given I have a Group named Group 1
And I go to the list of groups
And I have the following users records
| name | description | group_id |
| user 1 | | 1 |
| user 2 | | 1 |
When I follow Details for Group 1
Scenario: List users from group
Then I should see "user 1"
And I should see "user 2"
因此,在我的用户控制器的索引操作中,我列出了 group_id 中的所有用户,但我不知道如何使用 cucumber 进行测试,因为每次运行测试时,名为 Group 1 的组都有不同的 id。
有谁知道如何解决这个问题?
谢谢