6 use Test
::More
'tests' => 12;
14 my $db = NewDB
->new();
20 content
=> 'Look there!',
26 is
( $post->revision, 1 );
27 is
( $post->user_id, 1 );
28 is
( $post->title, 'Wow' );
29 is
( $post->content, 'Look there!' );
31 $post = Post
->new( id
=> $post->id );
33 is
( $post->revision, 1 );
35 my $old_addtime = $post->addtime;
39 is
( $post->revision, 1, 'Commit without changes' );
41 $post->title( $post->title );
43 is
( $post->revision, 1, 'Commit without changes' );
45 $post->title( 'Wuw' );
49 isnt
( $old_addtime, $post->addtime );
51 is
( $post->revision, 2 );
52 is
( $post->title, 'Wuw' );
54 is
( scalar @
{ $post->diffs }, 1 );
56 $post->delete( cascade
=> 1 );