rails/rails-dom-testing

Simple Form tests are completely broken

rafaelfranca opened this issue · 3 comments

Not sure why but some assertions of escaped values are being not escaped. Also some whitespaces are missing.

 14) Failure:
BooleanInputTest#test_input_boolean_with_nested_allows_:inline_label [/Users/rafaelfranca/src/plataformatec/simple_form/test/inputs/boolean_input_test.rb:53]:
< I am so inline.> expected but was
<I am so inline.>..
Expected 0 to be >= 1.
 18) Failure:
LabelTest#test_builder_escapes_label_text [/Users/rafaelfranca/src/plataformatec/simple_form/test/form_builder/label_test.rb:34]:
<&lt;script&gt;alert(1337)&lt;/script&gt;> expected but was
<<script>alert(1337)</script>>..
Expected 0 to be >= 1.

https://travis-ci.org/plataformatec/simple_form/jobs/34743207

The first problem is the way the constant was renamed. I just linked a commit fixing it.

Did another fix at rails side. Now we only need to understand why the output is not being escaped.

After some research we found out the output was escaped, but Nokogiri would unescape it during parsing causing the selectors not to match anything.
@rafaelfranca will change the selectors on the SimpleForm side.