[Jifty-commit] r6895 - JiftyX-CloudTags/t/TestApp/t

Jifty commits jifty-commit at lists.jifty.org
Fri Apr 24 06:39:40 EDT 2009


Author: c9s
Date: Fri Apr 24 06:39:37 2009
New Revision: 6895

Modified:
   JiftyX-CloudTags/t/TestApp/t/00-model-Labels.t

Log:
 more tests on jiftyx-cloudtags.

Modified: JiftyX-CloudTags/t/TestApp/t/00-model-Labels.t
==============================================================================
--- JiftyX-CloudTags/t/TestApp/t/00-model-Labels.t	(original)
+++ JiftyX-CloudTags/t/TestApp/t/00-model-Labels.t	Fri Apr 24 06:39:37 2009
@@ -8,7 +8,7 @@
 
 =cut
 
-use Jifty::Test tests => 9;
+use Jifty::Test tests => 12;
 
 # Make sure we can load the model
 use_ok('TestApp::Model::Labels');
@@ -50,16 +50,32 @@
 $rel->create( ref_label => $o ) for ( 1 .. 10 );
 
 use_ok( 'JiftyX::CloudTags' );
-
-my $tgen = new JiftyX::CloudTags;
-ok( $tgen );
-$tgen->set_tags( 'LabelsCollection' , 
-    text_by => 'name',
-    size_by => 'posts',
-    break_width => 200,
-);
-my $html = $tgen->render;
-like( $html , qr{\Q<span class="cloudtags" style="font-size: 48px;">} , 'html ok' );
-like( $html , qr{\Q<br/>} , 'br ok' );
-
-
+{
+    my $tgen = new JiftyX::CloudTags;
+    ok( $tgen );
+    $tgen->set_tags( 'LabelsCollection' , 
+        text_by => 'name',
+        size_by => 'posts',
+        break_width => 200,
+    );
+    my $html = $tgen->render;
+    like( $html , qr{\Q<span class="cloudtags" style="font-size: 48px;">} , 'html ok' );
+    like( $html , qr{\Q<br/>} , 'br ok' );
+}
+
+
+{
+    my $collection = M( 'LabelsCollection' );
+    $collection->unlimit;
+    ok( $collection );
+
+    my $tgen = new JiftyX::CloudTags;
+    ok( $tgen );
+    $tgen->set_tags(  $collection , 
+        text_by => 'name',
+        size_by => 'posts',
+        link_format => '%i %t %{hit}'
+    );
+    my $html = $tgen->render;
+    like( $html , qr{\Q<span class="cloudtags" style="font-size: 48px;">} , 'html ok' );
+}


More information about the Jifty-commit mailing list