[Catalyst-commits] r8374 - in CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk: . t t/lib/MyApp/Controller

karpet at dev.catalyst.perl.org karpet at dev.catalyst.perl.org
Tue Sep 9 13:22:06 BST 2008


Author: karpet
Date: 2008-09-09 13:22:06 +0100 (Tue, 09 Sep 2008)
New Revision: 8374

Modified:
   CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes
   CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/01-rdbo.t
   CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/lib/MyApp/Controller/Foo.pm
Log:
tweek tests for new core api output

Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes	2008-09-09 12:21:37 UTC (rev 8373)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes	2008-09-09 12:22:06 UTC (rev 8374)
@@ -51,5 +51,6 @@
         * support for 0.30 core api param name change
         * add 'int' to column types registered as 'treat_like_int'
         * fix query for _related methods.
+        * update tests to support new make_sql_query() format in core API
 
 

Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/01-rdbo.t
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/01-rdbo.t	2008-09-09 12:21:37 UTC (rev 8373)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/01-rdbo.t	2008-09-09 12:22:06 UTC (rev 8374)
@@ -43,15 +43,15 @@
 ok( $res = request('/foo/search?id=1&cxc-order=id'),
     "search id=1 with order" );
 
-is( $res->content, '{
+is( $res->content, qq/{
   limit           => 50,
   offset          => 0,
   plain_query     => { id => [1] },
-  plain_query_str => "id = 1",
-  query           => ["id", [1]],
+  plain_query_str => "(id='1')",
+  query           => ["id", 1],
   sort_by         => "t1.id ASC",
   sort_order      => [{ id => "ASC" }],
-}', "search query with order dir assumed"
+}/, "search query with order dir assumed"
 );
 
 #dump $res;
@@ -61,27 +61,27 @@
 
 #dump $res;
 
-is( $res->content, '{
+is( $res->content, qq/{
   limit           => 50,
   offset          => 0,
   plain_query     => { id => [1] },
-  plain_query_str => "id = 1",
-  query           => ["id", [1]],
+  plain_query_str => "(id='1')",
+  query           => ["id", 1],
   sort_by         => "t1.id DESC",
   sort_order      => [{ id => "DESC" }],
-}', "search query with explicit order/dir"
+}/, "search query with explicit order/dir"
 );
 
 ok( $res = request('/foo/search?id=1'), "search id=1 with no sort" );
-is( $res->content, '{
+is( $res->content, qq/{
   limit           => 50,
   offset          => 0,
   plain_query     => { id => [1] },
-  plain_query_str => "id = 1",
-  query           => ["id", [1]],
+  plain_query_str => "(id='1')",
+  query           => ["id", 1],
   sort_by         => "t1.id DESC",
   sort_order      => [{ id => "DESC" }],
-}', "search query with default PK order"
+}/, "search query with default PK order"
 );
 
 #dump $res;

Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/lib/MyApp/Controller/Foo.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/lib/MyApp/Controller/Foo.pm	2008-09-09 12:21:37 UTC (rev 8373)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/t/lib/MyApp/Controller/Foo.pm	2008-09-09 12:22:06 UTC (rev 8374)
@@ -43,6 +43,7 @@
     my ( $self, $c ) = @_;
     $c->log->debug( "resp status = " . $c->res->status ) if $c->debug;
     if ( $c->stash->{results} ) {
+        delete $c->stash->{results}->query->{query_obj};
         $c->res->body( Data::Dump::dump( $c->stash->{results}->query ) );
     }
     1;




More information about the Catalyst-commits mailing list