Remove useless valuation comment creation

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.
This commit is contained in:
Javi Martín
2019-09-28 01:01:41 +02:00
parent ce2b81f790
commit 49b47dd5f4

View File

@@ -27,7 +27,6 @@ describe "Commenting Budget::Investments" do
parent_comment = create(:comment, commentable: investment)
first_child = create(:comment, commentable: investment, parent: parent_comment)
second_child = create(:comment, commentable: investment, parent: parent_comment)
valuation_comment = create(:comment, :valuation, commentable: investment, subject: "Not viable")
visit comment_path(parent_comment)
@@ -35,7 +34,6 @@ describe "Commenting Budget::Investments" do
expect(page).to have_content parent_comment.body
expect(page).to have_content first_child.body
expect(page).to have_content second_child.body
expect(page).not_to have_content("Not viable")
expect(page).to have_link "Go back to #{investment.title}", href: budget_investment_path(investment.budget, investment)