开发者

Rspec getting undefined method error when I try to use fill_in on text field

Totally revising this question, since I fixed the first issue but have ran into a new one. My code now looks like this-

it 'should return on a partial match of Subject ID' do
  visit newpatient_path
  fill_in :subject_id, :with => "0303"
  click_button "Find Patient"
  response.should redirect_to(searchresult_path())
end

When I run this I get the following error-

  Patients SEARCH patient should return on a partial match of Subject ID
 Failure/Error: fill_in :subject_id,    :with => "0303"
 Webrat::NotFoundErro开发者_开发百科r:
   Could not find field: :subject_id
 # ./spec/requests/patients_spec.rb:26:in `block (3 levels) in <top (required)>'

subject_id is the text_field value for the field in question. Not sure why I can't find it? Thanks in advance!


I am no Webrat expert, but doesn't the fill_in method expect a String as its first argument? You are passing a Symbol; don't know whether that's allowed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜