Fix comment notifications on legislation proposals

The `commentable_url` method wasn't updated when we added legislation
proposals.

Back when we first created this method, we couldn't pass budget
investments or topics directly to `polymorphic_url` because they are
nested resources. That isn't the case since commit ff93f5a59, so now we
can simplify this method.

We're keeping the `commentable_url` method for now in order to keep
compatibility with custom changes that might use it, although this
method isn't consistent with the `commentable_path` method (which
receives a comment, and not a commentable), and so we might have to
revisit this code in the future.
This commit is contained in:
Javi Martín
2021-11-29 15:55:06 +01:00
parent 51da643f2a
commit 735f99f877
2 changed files with 7 additions and 5 deletions

View File

@@ -22,5 +22,11 @@ describe Mailer do
expect(email).to deliver_from "New organization <new@consul.dev>"
end
it "sends emails for comments on legislation proposals" do
email = Mailer.comment(create(:legislation_proposal_comment))
expect(email.subject).to include("commented on your proposal")
end
end
end