[Rt-commit] rt branch, 4.0/test-CF-context, created. rt-4.0.10-82-g8cf1288

Ruslan Zakirov ruz at bestpractical.com
Wed Mar 13 11:26:09 EDT 2013


The branch, 4.0/test-CF-context has been created
        at  8cf12883b9a94c93c08d7e7d938c684bb358a2ca (commit)

- Log -----------------------------------------------------------------
commit 8cf12883b9a94c93c08d7e7d938c684bb358a2ca
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Feb 3 03:02:40 2012 +0400

    test CF's context via UI
    
    there was a bug that CF value was set to "no value" on submit if
    CF rights are granted via queue and CF is not changed.

diff --git a/t/customfields/access_via_queue.t b/t/customfields/access_via_queue.t
index cca45e7..a059d69 100644
--- a/t/customfields/access_via_queue.t
+++ b/t/customfields/access_via_queue.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 37;
+use RT::Test nodata => 1, tests => 47;
 use RT::Ticket;
 use RT::CustomField;
 
@@ -157,3 +157,30 @@ diag "check that owner can see and edit CF";
     $m->content_contains($cf_name, "changed cf");
 }
 
+note 'make sure CF is not reset to no value';
+{
+    my $t = RT::Test->create_ticket(
+        Queue => $queue->id,
+        Subject => 'test',
+        'CustomField-'.$cf->id => '2012-02-12',
+        Cc => $tester->id,
+        Owner => $tester->id,
+    );
+    ok $t && $t->id, 'created ticket';
+    is $t->FirstCustomFieldValue($cf_name), '2012-02-12';
+
+    $m->goto_ticket($t->id);
+    $m->follow_link_ok({id => 'page-basics'});
+    my $form = $m->form_name('TicketModify');
+    my $input = $form->find_input(
+        'Object-RT::Ticket-'. $t->id .'-CustomField-'. $cf->id .'-Value'
+    );
+    ok $input, 'found input';
+    $m->click('SubmitTicket');
+
+    my $tid = $t->id;
+    $t = RT::Ticket->new( $RT::SystemUser );
+    $t->Load( $tid );
+    is $t->FirstCustomFieldValue($cf_name), '2012-02-12';
+}
+

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


More information about the Rt-commit mailing list