[Bast-commits] r9901 - ironman/IronMan-Web/branches/idn-20110706/t

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Wed Jul 6 16:37:34 GMT 2011


Author: idn
Date: 2011-07-06 16:37:34 +0000 (Wed, 06 Jul 2011)
New Revision: 9901

Added:
   ironman/IronMan-Web/branches/idn-20110706/t/03_resultset_feed.t
Log:
Populate some test data

Added: ironman/IronMan-Web/branches/idn-20110706/t/03_resultset_feed.t
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/t/03_resultset_feed.t	                        (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/t/03_resultset_feed.t	2011-07-06 16:37:34 UTC (rev 9901)
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+# Test the IronMan::Schema::ResultSet::Feed local functions.
+
+use IronMan::Schema;
+
+my $dir = "t/var/";
+my $file = "test.db";
+
+my $schema = IronMan::Schema->connect("dbi:SQLite:$dir$file");
+
+my %feed = (
+    url   => "http://www.google.com/",
+    title => "Google homepage",
+    email => 'google at example.com',
+);
+
+# Array for the results from add_new_blog
+my @new_blog_result;
+
+# Attempt to add a new blog.
+ at new_blog_result = $schema->resultset('Feed')->add_new_blog(%feed);
+
+# Check the result
+is($new_blog_result[0], 1, "Adding a new blog feed.");
+
+# Attempt to add the same blog again.
+ at new_blog_result = $schema->resultset('Feed')->add_new_blog(%feed);
+
+# Check the result
+is($new_blog_result[0], 0, "Adding a duplicate blog feed.");
+




More information about the Bast-commits mailing list