assertEquals(c, ca.comment);
}
@Test
public void addCommentNonValid() {
Talk t = createTalk("test");
// Ensure the talk is unvalid
t.valid = false;
t.save();
// Non activity for the session
assertEquals(0, Activity.count("session = ?", t));
SessionComment c = new SessionComment(member, t, "Un commentaire");
t.addComment(c);
t.save();
// Still no activity for the session
assertEquals(0, Activity.count("session = ?", t));
t.validate();
// 1 comment activity amongst others
assertEquals(1, CommentSessionActivity.count("session = ?", t));
Activity a = CommentSessionActivity.find("session = ?", t).first();
assertActivity(a);
assertTrue(a instanceof CommentSessionActivity);