2010-05-17 112 views
0

码的步骤文件:Webrat select_date选择失败

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

是不是bug,或者我我在做错事

回答

0

使用 “id_prefix” 的说法

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

然而,这似乎是Webrat的bug解决。