我在页面上有重置按钮,清除所有表单字段。但是如何在capybara中对这个功能进行测试?
我试过了:
#view
<%= f.submit "Reset", :type => "reset", :id => "reset", :class => "btn btn-large" %>
#spec
fill_in 'wifi_name_zip', :with => "testzip"
find(:xpath,"//input[@type='reset']", "test").click
find_field('wifi_name_full_name').value.should be_blank
但我接受了:
Failure/Error: find_field('wifi_name_full_name').value.should be_blank
expected blank? to return true, got false