[Bast-commits] r9092 - ironman/IronMan-Schema/t
idn at dev.catalyst.perl.org
idn at dev.catalyst.perl.org
Tue Apr 6 21:55:37 GMT 2010
Author: idn
Date: 2010-04-06 22:55:37 +0100 (Tue, 06 Apr 2010)
New Revision: 9092
Modified:
ironman/IronMan-Schema/t/04_resultset_post.t
Log:
Split creation of test data from the unit tests to avoid creation of duplicate records
Modified: ironman/IronMan-Schema/t/04_resultset_post.t
===================================================================
--- ironman/IronMan-Schema/t/04_resultset_post.t 2010-04-06 21:53:47 UTC (rev 9091)
+++ ironman/IronMan-Schema/t/04_resultset_post.t 2010-04-06 21:55:37 UTC (rev 9092)
@@ -12,6 +12,9 @@
my $schema = IronMan::Schema->connect("dbi:SQLite:$dir$file");
+my $feed = $schema->resultset('Feed');
+$feed = $feed->next;
+
# Create a DateTime for right now.
my $dt = DateTime->now;
@@ -20,9 +23,13 @@
# Get posts_for_day
ok($posts = $schema->resultset('Post')->posts_for_day($dt));
+diag("Got '" . $posts->count . "' posts for today");
+
# Get posts_for_month
ok($posts = $schema->resultset('Post')->posts_for_month($dt));
+diag("Got '" . $posts->count . "' posts for the month");
+
# Calculate the DateTime for start and end of our DateTime created above
my $month_start = $dt->clone()->truncate( 'to' => 'month');
my $month_end = $month_start->clone()->add( 'months' => 1 )->subtract( 'seconds' => 1 );
More information about the Bast-commits
mailing list