0

步骤文件中的代码:

  select_date user.date_of_birth, :from => "Date of birth"

选择器失败

When I register with valid user credentials # features/step_definitions/authentication_steps.rb:2
  Could not find field: "user_date_of_birth_1i_1i" (Webrat::NotFoundError)
  ./features/step_definitions/authentication_steps.rb:9:in `/^I register with valid user credentials$/'
  features/authentication.feature:6:in `When I register with valid user credentials'

HTML输出似乎是正常的:

<select name="user[date_of_birth(1i)]" id="user_date_of_birth_1i">

是错误还是我做错了什么

4

1 回答 1

0

使用“id_prefix”参数解决

  select_date user.date_of_birth, :id_prefix => "user_date_of_birth"

然而,这似乎是 Webrat 的错误。

于 2010-05-17T20:02:24.673 回答