Webrat select_date选择器失败

时间:2010-05-17 19:44:59

标签: ruby-on-rails cucumber webrat

步骤文件中的代码:

  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">

是错误,还是我做错了

1 个答案:

答案 0 :(得分:0)

使用“id_prefix”参数

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

但它似乎是Webrat的错误。