When I simply use
assert_select td, "test"
it seems that it expects the first of the found td-elements to have the value test.
So I tried to first select all of them in an array, and then assume that the array contains the expected value:
assert_select 'td' do |elements|
assert elements.include?("test")
end
But this also doesn't work for me, as it is always green. I am not really sure which parts of Rails and Ruby are available in the test so this last idea was just a shot in the dark.
Try this
assert_select 'td', /test/
it seems your td in not contains test only. // will work because it will match rather then comparing exact values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With