[Jifty-commit] r6256 - in jifty/trunk: t/TestApp-Plugin-ActorMetadata/t

Jifty commits jifty-commit at lists.jifty.org
Sat Jan 17 12:11:42 EST 2009


Author: sunnavy
Date: Sat Jan 17 12:11:42 2009
New Revision: 6256

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/t/TestApp-Plugin-ActorMetadata/t/actormetadata.t

Log:
 r6287 at sunnavys-mb:  sunnavy | 2009-01-18 01:10:55 +0800
 more tests for actormeta


Modified: jifty/trunk/t/TestApp-Plugin-ActorMetadata/t/actormetadata.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-ActorMetadata/t/actormetadata.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-ActorMetadata/t/actormetadata.t	Sat Jan 17 12:11:42 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 17;
+use Test::More tests => 26;
 use Jifty::Test::Dist;
 my ( $user_foo, $user_bar );
 
@@ -56,6 +56,24 @@
 ok( abs( $post->updated_on->epoch - Jifty::DateTime->now->epoch ) < 2,
     'update_on is updated' );
 
+# creator and created are columns of comment, post doesn't have those
+for my $method (qw/creator created/) {
+    ok( !$post->can($method), "no method $method" );
+}
+
+my $comment =
+  TestApp::Plugin::ActorMetadata::Model::Comment->new( current_user => $user_foo );
+
+$now = Jifty::DateTime->now;
+$comment->create();
+ok( $comment->id, 'created a comment' );
+is( $comment->creator->id, $user_foo->id, 'creator is set' );
+ok( abs( $comment->created->epoch - $now->epoch < 2 ), 'created is set' );
+
+for my $method (qw/created_by created_on updated_by updated_on/) {
+    ok( !$comment->can($method), "no method $method" );
+}
+
 
 sub mysleep {
     my $second = shift;


More information about the Jifty-commit mailing list