开发者

Webrat select_date selector failure

开发者 https://www.devze.com 2022-12-31 14:44 出处:网络
Code in steps file: select_date user.date_of_birth, :from => \"Date of birth\" Selector fail When I register with valid user credentials # features/step_definitions/authentication_steps.rb:2

Code in steps file:

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

Selector fail

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_def开发者_开发问答initions/authentication_steps.rb:9:in `/^I register with valid user credentials$/'
  features/authentication.feature:6:in `When I register with valid user credentials'

HTML output seems to be normal:

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

Is it bug, or I am doing something wrong


Solved using "id_prefix" argument

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

Yet it seems to be Webrat's bug.

0

精彩评论

暂无评论...
验证码 换一张
取 消