我在使用 ruby on rails 开发的应用程序中有下表:
我想在黄瓜中创建一个测试,我从表中选择一个用户并将其删除或编辑。
我不知道它的步骤定义是什么。
我希望能够做类似的事情:
Feature: User Manegement
In order to manage users
As an admin
I want to see a users list and change user properties
Background:
Given the following activated users exists
| name | email |
| Alice Hunter | alice.hunter@example.com |
| Bob Hunter | bob.hunter@example.com |
And the following user records
| name | email |
| Jonh Doe | jonh.doe@example.com |
Scenario: I delete a user from the table
Given I am logged in as admin
When I follow "Administration"
And I follow "User Management"
And I delete "Alice Hunter"
Then I should not see "Alice Hunter"`
任何人都可以帮忙吗?谢谢你。
@布拉德
返回的错误:
wrong number of arguments (2 for 1) (ArgumentError)
./features/step_definitions/table_steps.rb:26:in `within'
./features/step_definitions/table_steps.rb:26:in `/^I delete "(.*)"$/'