如何使用水豚测试“重置字段规范”?

时间:2012-04-03 18:17:00

标签: ruby-on-rails ruby-on-rails-3 rspec capybara

我在页面上有重置按钮,清除所有表单字段。但是如何在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

0 个答案:

没有答案
相关问题