| 
      
            Lines 44-59
          subtest 'CRUD' => sub {
      
      
        Link Here
      
     | 
  
        
          | 44 | 
              is( $shelf->allow_delete_other, 0, 'The default value for allow_delete_other should be 0' );  | 
          44 | 
              is( $shelf->allow_delete_other, 0, 'The default value for allow_delete_other should be 0' );  | 
        
        
          | 45 | 
              is( output_pref($shelf->created_on), output_pref(dt_from_string), 'The creation time should have been set to today' );  | 
          45 | 
              is( output_pref($shelf->created_on), output_pref(dt_from_string), 'The creation time should have been set to today' );  | 
        
        
          | 46 | 
           | 
          46 | 
           | 
        
          
            
              | 47 | 
                  my $shelf_18672 = Koha::Virtualshelves->find( $shelf->shelfnumber ); # Bug 18672  | 
              47 | 
                  # Test if creation date will not be overwritten by store  | 
            
            
              | 48 | 
                  my $created_18672 = $shelf_18672->created_on;  | 
              48 | 
                  my $created = dt_from_string->subtract( hours => 1 );  | 
            
            
              | 49 | 
                  sleep 2; # Wait 2 seconds, then store  | 
              49 | 
                  $shelf->created_on( $created );  | 
            
        
          | 50 | 
              $shelf->store;  | 
          50 | 
              $shelf->store;  | 
        
            
              | 51 | 
                  $shelf_18672 = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
               | 
               | 
            
            
              | 52 | 
                  is($shelf_18672->created_on, $created_18672, 'Creation date is the same after update (Bug 18672)' );  | 
            
        
          | 53 | 
           | 
          51 | 
           | 
        
        
          | 54 | 
              my $retrieved_shelf = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
          52 | 
              my $retrieved_shelf = Koha::Virtualshelves->find( $shelf->shelfnumber );  | 
        
        
          | 55 | 
           | 
          53 | 
           | 
        
        
          | 56 | 
              is( $retrieved_shelf->shelfname, $shelf->shelfname, 'Find should correctly return the shelfname' );  | 
          54 | 
              is( $retrieved_shelf->shelfname, $shelf->shelfname, 'Find should correctly return the shelfname' );  | 
        
            
               | 
               | 
              55 | 
                  is( dt_from_string($retrieved_shelf->created_on), $created, 'Creation date is the same after update (Bug 18672)' );  | 
            
        
          | 57 | 
           | 
          56 | 
           | 
        
        
          | 58 | 
              # Insert with the same name  | 
          57 | 
              # Insert with the same name  | 
        
        
          | 59 | 
              eval { | 
          58 | 
              eval { | 
        
            
              | 60 | 
              -   | 
               | 
               |