Ordered now works correctly with MC too \o/
[dbsrgits/DBIx-Class.git] / t / 96multi_create.t
index 965ab54..e07bfd9 100644 (file)
@@ -6,11 +6,11 @@ use Test::Exception;
 use lib qw(t/lib);
 use DBICTest;
 
-plan tests => 85;
+plan tests => 77;
 
 my $schema = DBICTest->init_schema();
 
-diag '* simple create + parent (the stuff $rs belongs_to)'
+diag '* simple create + parent (the stuff $rs belongs_to)';
 eval {
   my $cd = $schema->resultset('CD')->create({
     artist => { 
@@ -91,9 +91,9 @@ eval {
       title => 'Bad investment',
       year => 2008,
       tracks => [
-        { position => 1, title => 'Just buy' },
-        { position => 2, title => 'Why did we do it' },
-        { position => 3, title => 'Burn baby burn' },
+        { title => 'Just buy' },
+        { title => 'Why did we do it' },
+        { title => 'Burn baby burn' },
       ],
     },
     producer => {
@@ -133,19 +133,17 @@ eval {
     year => 2008,
     tracks => [
       {
-        position => 1, # some day me might test this with Ordered
         title => 'Off by one again',
       },
       {
-        position => 2,
         title => 'The dereferencer',
         cd_single => {
           artist => $artist,
           year => 2008,
           title => 'Was that a null (Single)',
           tracks => [
-            { title => 'The dereferencer', position => 1 },
-            { title => 'The dereferencer II', position => 2 },
+            { title => 'The dereferencer' },
+            { title => 'The dereferencer II' },
           ],
           cd_to_producer => [
             {
@@ -204,16 +202,15 @@ eval {
   my $cd = $schema->resultset('CD')->first;
   my $track = $schema->resultset('Track')->create ({
     cd => $cd,
-    position => 77,  # some day me might test this with Ordered
     title => 'Multicreate rocks',
     cd_single => {
       artist => $cd->artist,
       year => 2008,
       title => 'Disemboweling MultiCreate',
       tracks => [
-        { title => 'Why does mst write this way', position => 1 },
-        { title => 'Chainsaw celebration', position => 2 },
-        { title => 'Purl cleans up', position => 3 },
+        { title => 'Why does mst write this way' },
+        { title => 'Chainsaw celebration' },
+        { title => 'Purl cleans up' },
       ],
       cd_to_producer => [
         {
@@ -303,7 +300,6 @@ eval {
   my $cd = $schema->resultset('CD')->first;
   my $track = $schema->resultset ('Track')->create ({
     cd => $cd,
-    position => 66,
     title => 'Black',
     lyrics => {
       lyric_versions => [
@@ -441,13 +437,8 @@ eval {
                title => 'TestOneCD1',
                year => 2007,
                tracks => [
-               
-                       { position=>111,
-                         title => 'TrackOne',
-                       },
-                       { position=>112,
-                         title => 'TrackTwo',
-                       }
+                       { title => 'TrackOne' },
+                       { title => 'TrackTwo' },
                ],
 
        });
@@ -475,13 +466,8 @@ eval {
                title => 'TestOneCD2',
                year => 2007,
                tracks => [
-               
-                       { position=>111,
-                         title => 'TrackOne',
-                       },
-                       { position=>112,
-                         title => 'TrackTwo',
-                       }
+                       { title => 'TrackOne' },
+                       { title => 'TrackTwo' },
                ],
 
     liner_notes => { notes => 'I can haz liner notes?' },
@@ -513,9 +499,6 @@ eval {
 };
 diag $@ if $@;
 
-TODO: {
-local $TODO = 'Next 2 evals are NOT supposed to work, jnaps code will be torn to bits in another branch';
-#SPECIAL_CASE
 eval {
   my $kurt_cobain = { name => 'Kurt Cobain' };
 
@@ -536,7 +519,8 @@ eval {
 };
 diag $@ if $@;
 
-#SPECIAL_CASE2
+=pod
+# This test case has been moved to t/96multi_create/cd_single.t
 eval {
   my $pink_floyd = { name => 'Pink Floyd' };
 
@@ -552,10 +536,11 @@ eval {
   is($a->cds && $a->cds->first->title, 'The Wall', 'CD insertion ok');
 };
 diag $@ if $@;
-}
-
+=cut
 
 diag '* Create foreign key col obj including PK (See test 20 in 66relationships.t)';
+## Create foreign key col obj including PK
+## See test 20 in 66relationships.t
 eval {
   my $new_cd_hashref = { 
     cdid => 27,