[Rt-commit] rt branch, 5.0/remove-catalog-modal, updated. rt-4.4.4-769-g17e15495c

Michel Rodriguez michel at bestpractical.com
Wed Feb 26 10:49:55 EST 2020


The branch, 5.0/remove-catalog-modal has been updated
       via  17e15495ccc052a7a508b9699fd75491461a9822 (commit)
      from  cad2a52c8eb30a393826c30a381cde8c8b26e473 (commit)

Summary of changes:
 t/web/asset_create.t | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 17e15495ccc052a7a508b9699fd75491461a9822
Author: michel <michel at bestpractical.com>
Date:   Wed Feb 26 16:49:20 2020 +0100

    Improved lifecycle test.
    
    Still not passing though.

diff --git a/t/web/asset_create.t b/t/web/asset_create.t
index ad9ab36ba..9069aefd0 100644
--- a/t/web/asset_create.t
+++ b/t/web/asset_create.t
@@ -9,11 +9,19 @@ my $lifecycles = RT->Config->Get('Lifecycles');
 RT->Config->Set(
     Lifecycles => %{$lifecycles},
     foo        => {
+        type => 'asset',
         initial  => ['initial'],
         active   => ['tracked'],
         inactive => ['retired'],
-    }
+        defaults => { on_create => 'initial', },
+        transitions => {
+            ''        => [qw(initial tracked)],
+            initial   => [qw(tracked retired)],
+            tracked   => [qw(retired)],
+        },
+    },
 );
+RT->Config->Set( Lifecycles => %{$lifecycles} );
 RT::Lifecycle->FillCache();
 
 RT->Config->Set( DefaultCatalog => 'Default catalog' );
@@ -22,7 +30,7 @@ RT->Config->Set( DefaultCatalog => 'Default catalog' );
 my $catalog_1 = RT::Test::Assets->load_or_create_catalog( Name => 'Default catalog' );
 ok( $catalog_1, 'created catalog 1' );
 my $catalog_2 = RT::Test::Assets::->load_or_create_catalog( Name => 'Another catalog' );
-ok( $catalog_2, 'created catalog 2' );
+ok( $catalog_2, 'created catalog 2 id:' . $catalog_2->id );
 my $user   = RT::Test::Assets->load_or_create_user(
     Name     => 'user',
     Password => 'password',
@@ -67,7 +75,7 @@ is( $m->form_name('CreateAsset')->value($cf_form_id), '', 'custom field present
 
 my $form         = $m->form_name('CreateAsset');
 my $status_input = $form->find_input('Status');
-note( "values: " . join( ' - ', map { "[$_]" } $status_input->possible_values ) );
+note( "catalog " . $catalog_2->id . " - lifecycle values: " . join( ' - ', map { "[$_]" } $status_input->possible_values ) );
 is_deeply(
     [ $status_input->possible_values ],
     [ 'initial', 'tracked', 'retired' ],

-----------------------------------------------------------------------


More information about the rt-commit mailing list