assertEquals(c, ca.comment);
}
@Test
public void addCommentNonValid() {
Article article = createArticle("test");
article.valid = false;
article.save();
// No activity for the article
assertEquals(0, Activity.count("article = ?", article));
ArticleComment c = new ArticleComment(member, article, "Un commentaire");
article.addComment(c);
article.save();
// Still no activity for the article
assertEquals(0, Activity.count("article = ?", article));
article.validate();
// 1 comment activity amongst others
assertEquals(1, CommentArticleActivity.count("article = ?", article));
Activity a = CommentArticleActivity.find("article = ?", article).first();
assertActivity(a);
assertTrue(a instanceof CommentArticleActivity);