Skip to content Skip to sidebar Skip to footer

How To Assert That An Input Element Is Empty In Ruby On Rails Tests

I want to ensure that the password fields are empty when editing a user. How do I do this in a functional test? I've tried both of these variants: assert_select 'input[name=?][val

Solution 1:

Try this:

assert_select 'input:not([value])[name="user[password1]"]', true

Solution 2:

in cucumber/webrat sth like page.should_not have_xpath("//input[contains(@value, \"\")]") works

Post a Comment for "How To Assert That An Input Element Is Empty In Ruby On Rails Tests"