[Bast-commits] r8977 - ironman/IronMan-Schema/t

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Thu Mar 11 20:26:05 GMT 2010


Author: idn
Date: 2010-03-11 20:26:05 +0000 (Thu, 11 Mar 2010)
New Revision: 8977

Added:
   ironman/IronMan-Schema/t/03_resultset_feed_add_new_blog.t
Log:
Adding tests for add_new_blog

Added: ironman/IronMan-Schema/t/03_resultset_feed_add_new_blog.t
===================================================================
--- ironman/IronMan-Schema/t/03_resultset_feed_add_new_blog.t	                        (rev 0)
+++ ironman/IronMan-Schema/t/03_resultset_feed_add_new_blog.t	2010-03-11 20:26:05 UTC (rev 8977)
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+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