【发布时间】:2010-11-22 18:30:31
【问题描述】:
我在使用 ruby on rails 开发的应用程序中有下表:
我想在 cucumber 中创建一个测试,从表中选择一个用户并将其删除或编辑。
我不知道它的步骤定义是什么。
我希望能够做类似的事情:
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 "(.*)"$/'
【问题讨论】:
-
您可以将您的功能/场景添加到帖子中吗?
-
添加了我想做的例子。基本上我想模拟点击 Alice Hunter 旁边的删除链接。
标签: ruby-on-rails cucumber webrat