【发布时间】:2011-09-12 14:00:14
【问题描述】:
我想确保在编辑用户时密码字段为空。我如何在功能测试中做到这一点?
我已经尝试了这两种变体:
assert_select "input[name=?][value=?]", 'user[password1]', ''
和
assert_tag :tag => "input", :attributes => {:name => "user[password1]", :value => ""}
两者都失败了,因为生成的 html 中没有 value= 属性。我没有看到任何测试属性是否不出现在生成的 html 中的方法?
【问题讨论】:
标签: html ruby-on-rails forms testing