The valuation comment doesn't show up in the comment show action because
it's not a child of the parent comment. With a regular comment, the test
passes as well.
However, if we make the valuation comment a child of the parent comment,
it shows up both in the index and show actions. That's because the
method `root_descendants` in the `CommentTree` class doesn't filter
valuation comments. I'm not sure whether it's a bug or the intended
behaviour.
We've got a bug which causes the admin description not to appear
immediately after commenting, due to the `admin_layout` variable being
false when we add a comment using an AJAX request.
So the test reloaded the page to check the admin description was there.
However, sometimes reloading the page is faster than the AJAX request,
and so the comment is not there yet.
By checking the results of the AJAX request before reloading the page,
the test passes.
A proper solution would be to display the admin description or name
right after the comment is added.
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.
Because of this change, we also need to change `background` to `before`
or else these tests will fail.
How:
Using a local variable at partials to set a hidden true/false value for
`valuation` parameter on the comment creation form.
Allowing that new param at the comment controller and using it when
building a new Comment.