[Bps-public-commit] RT-Extension-MandatoryOnTransition branch, master, updated. 0.14-15-g741803e

? sunnavy sunnavy at bestpractical.com
Thu Sep 20 10:05:52 EDT 2018


The branch, master has been updated
       via  741803edcc693fed6b27699f7d746c162e43ef62 (commit)
       via  5d1b1423172a605364255918bb9cbb17c3d1ad3b (commit)
       via  8a2648163cce2622dbdbf02971a57d69ef07ae75 (commit)
      from  4e760802215d664d62e98b66cd97441c00bad64f (commit)

Summary of changes:
 MANIFEST          |  1 +
 xt/basic.t        |  1 +
 xt/queue_change.t | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)
 create mode 100644 xt/queue_change.t

- Log -----------------------------------------------------------------
commit 8a2648163cce2622dbdbf02971a57d69ef07ae75
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 20 21:57:08 2018 +0800

    Add back the test for the MassageCustomFields callback
    
    It was mistakenly deleted along with the MassageCustomFields callback in
    commit f44b7229. Since we rescued MassageCustomFields, its tests should
    be back too.

diff --git a/xt/basic.t b/xt/basic.t
index 86017dc..3823fe6 100644
--- a/xt/basic.t
+++ b/xt/basic.t
@@ -88,6 +88,7 @@ diag "Try a resolve without TimeWorked";
 
     $m->follow_link_ok( { text => 'Resolve' }, 'Try to resolve ticket');
     $m->content_contains('Test Field');
+    $m->content_lacks('XXX Optional Field ZZZ');
     $m->submit_form_ok( { form_name => 'TicketUpdate',
                           button => 'SubmitTicket',},
                           'Submit resolve with no Time Worked');

commit 5d1b1423172a605364255918bb9cbb17c3d1ad3b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 20 22:05:00 2018 +0800

    Add tests for the queue change feature

diff --git a/xt/queue_change.t b/xt/queue_change.t
new file mode 100644
index 0000000..4d0b5e9
--- /dev/null
+++ b/xt/queue_change.t
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+
+use RT::Extension::MandatoryOnTransition::Test tests => undef, config => <<CONFIG
+Set( %MandatoryOnTransition,
+     'General' => {
+         'Foo' => [ 'TimeWorked' ],
+     }
+);
+CONFIG
+  ;
+
+my ( $baseurl, $m ) = RT::Test->started_ok();
+
+ok( $m->login(), 'logged in' );
+
+my $queue_general = RT::Test->load_or_create_queue( Name => 'General' );
+my $queue_foo     = RT::Test->load_or_create_queue( Name => 'Foo' );
+
+my $ticket = RT::Test->create_ticket(
+    Queue   => 'General',
+    Subject => 'Test ticket for queue change',
+    Content => 'Testing',
+);
+
+$m->goto_ticket( $ticket->id );
+$m->follow_link_ok( { text => 'Basics' } );
+$m->submit_form_ok(
+    {   form_name => 'TicketModify',
+        fields    => { Queue => $queue_foo->id, },
+        button    => 'SubmitTicket',
+    },
+    'Change queue without required TimeWorked',
+);
+
+$m->text_contains( 'Time Worked is required when changing Queue' );
+
+$ticket->Load( $ticket->id );
+is( $ticket->Queue, $queue_general->id, 'Queue is not updated' );
+
+$m->submit_form_ok(
+    {   form_name => 'TicketModify',
+        fields    => { Queue => $queue_foo->id, TimeWorked => 10 },
+        button    => 'SubmitTicket',
+    },
+    'Change queue with required TimeWorked',
+);
+$m->text_contains( 'Worked 10 minutes' );
+$m->text_contains( 'Queue changed from General to Foo' );
+
+$ticket->Load( $ticket->id );
+is( $ticket->Queue, $queue_foo->id, 'Queue is updated' );
+
+done_testing;

commit 741803edcc693fed6b27699f7d746c162e43ef62
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 20 22:05:17 2018 +0800

    Update manifest

diff --git a/MANIFEST b/MANIFEST
index 89aa8e6..308cbb0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -37,4 +37,5 @@ README
 xt/basic.t
 xt/immutable_core_for_update.t
 xt/mandatory_on_create.t
+xt/queue_change.t
 xt/required_fields.t

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


More information about the Bps-public-commit mailing list