[Rt-commit] rt branch, 4.2/skip-validating-unsubmitted-cfs, updated. rt-4.1.5-159-gf746f5c

Thomas Sibley trs at bestpractical.com
Mon Dec 24 23:23:57 EST 2012


The branch, 4.2/skip-validating-unsubmitted-cfs has been updated
       via  f746f5cf346416c9ff6e4459e90f45d7055c34e3 (commit)
       via  918a3ad970254644551da907bf5ebcc38b36ffcf (commit)
       via  8353dfc068c598df6af41fcf44a5c830301f86bc (commit)
       via  5ec13121aec049e3592d9366210b9473a5a68623 (commit)
       via  e93d90bc27ceaf9ad552298186036b60d4cb96e0 (commit)
       via  f96bb707cc4a4b652e867026dc80afe015dbf604 (commit)
       via  3f44e97021684c78fbd8eab38b56e3fabc6c2221 (commit)
       via  21e208a7fdf14a447521e9bf2a734eef1486fc2c (commit)
       via  c5fe1cbc7b44435444c0bc8161977d9e0ab74f6b (commit)
       via  eeb10ae030b1fa125331dc7af96f6f0a08673ca3 (commit)
      from  80b777fb852325e28d5c21dbaaa9206745a71930 (commit)

Summary of changes:
 share/html/Elements/EditCustomFields     |  6 +++
 share/html/Elements/ValidateCustomFields |  4 +-
 share/html/Ticket/Modify.html            | 33 +++++++++-----
 share/html/Ticket/ModifyAll.html         | 64 ++++++++++++++-------------
 share/html/index.html                    | 27 +++++++++---
 t/web/cf_groupings.t                     | 11 ++---
 t/web/cf_pattern.t                       | 74 ++++++++++++++++++++++++++++++++
 7 files changed, 167 insertions(+), 52 deletions(-)
 create mode 100644 t/web/cf_pattern.t

- Log -----------------------------------------------------------------
commit eeb10ae030b1fa125331dc7af96f6f0a08673ca3
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 18:14:48 2012 -0800

    Failing tests demonstrating the disappearance of CF validation hints
    
    Validating only submitted CFs (80b777f) broke pages which relied on
    pre-validating to populate the CF "hints".

diff --git a/t/web/cf_pattern.t b/t/web/cf_pattern.t
new file mode 100644
index 0000000..6c73a93
--- /dev/null
+++ b/t/web/cf_pattern.t
@@ -0,0 +1,59 @@
+use strict;
+use warnings;
+
+use RT::Test tests => 'no_declare';
+
+my ($base, $m) = RT::Test->started_ok;
+
+my $cf = RT::Test->load_or_create_custom_field(
+    Name        => 'Yaks',
+    Type        => 'FreeformSingle',
+    Pattern     => '(?#Digits)^\d+$',
+    Queue       => 0,
+    LookupType  => 'RT::Queue-RT::Ticket',
+);
+ok $cf && $cf->id, "Created CF with Pattern";
+
+my $ticket = RT::Test->create_ticket(
+    Queue   => 1,
+    Subject => 'a test ticket',
+);
+ok $ticket && $ticket->id, "Created ticket";
+
+$m->login;
+
+for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->id) {
+    $m->get_ok($page, "Fetched $page");
+    $m->content_contains("Yaks");
+    $m->content_contains("Input must match [Digits]");
+    $m->content_lacks("cfinvalidfield");
+
+    my $cfinput = join "-", "Object", "RT::Ticket", ($page =~ /Create/ ? "" : $ticket->id),
+                            "CustomField", $cf->id, "Value";
+    $m->submit_form_ok({
+        with_fields => {
+            $cfinput            => "too many",
+            "${cfinput}s-Magic" => "1",
+        },
+    });
+    $m->content_contains("Input must match [Digits]");
+    $m->content_contains("cfinvalidfield");
+
+    $m->submit_form_ok({
+        with_fields => {
+            $cfinput            => "42",
+            "${cfinput}s-Magic" => "1",
+        },
+    });
+
+    if ($page =~ /Create/) {
+        $m->content_like(qr/Ticket \d+ created/, "Created ticket");
+    } else {
+        $m->content_contains("Yaks 42 added", "Updated ticket");
+        $m->content_contains("Input must match [Digits]");
+        $m->content_lacks("cfinvalidfield");
+    }
+}
+
+undef $m;
+done_testing;

commit c5fe1cbc7b44435444c0bc8161977d9e0ab74f6b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 18:17:54 2012 -0800

    Show custom field input hints (FriendlyPattern) when editing
    
    Defaults on for usability: it's nicer to note what format to use before
    submitting, rather than rejecting after submission.  The hint message is
    the same as the validation message at the moment (but could change in
    the future), except it renders in black instead of red.  If invalid
    input is nevertheless submitted, the error (in red) is shown instead of
    the hint.
    
    This makes t/web/cf_pattern.t pass for ticket creation, but the modify
    pages still need further fixing.

diff --git a/share/html/Elements/EditCustomFields b/share/html/Elements/EditCustomFields
index 8964315..8d97b40 100644
--- a/share/html/Elements/EditCustomFields
+++ b/share/html/Elements/EditCustomFields
@@ -69,6 +69,11 @@
 %  if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
         <br />
         <span class="cfinvalidfield"><% $msg %></span>
+%  } elsif ($ShowHints and $CustomField->FriendlyPattern) {
+        <br>
+        <span class="cfhints">
+          <&|/l, $CustomField->FriendlyPattern &>Input must match [_1]</&>
+        </span>
 %  }
     </<% $CELL %>>
   </<% $FIELD %>>
@@ -106,4 +111,5 @@ $CustomFields => undef
 $Grouping     => undef
 $AsTable => 1
 $InTable => 0
+$ShowHints => 1
 </%ARGS>

commit 21e208a7fdf14a447521e9bf2a734eef1486fc2c
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 18:22:56 2012 -0800

    Validate submitted CFs on the ticket modify pages
    
    Previously ValidateCustomFields was run with an empty argument set and
    an unloaded ticket object (the default).  This provided only field
    hints, without actually validating submitted values.
    
    Since hints are now handled via EditCustomFields itself, switch to
    validating submitted CFs.  This switch has the advantage of only marking
    invalid the fields which actually contain invalid values, the upshot of
    which is less glaring red text on initial page load.
    
    Since %ARGS is now used, the callsites moved to place them after
    callbacks which may modify %ARGS.  This ensures that CF validation will
    match any validation errors ProcessObjectCustomFieldUpdates() returns.

diff --git a/share/html/Ticket/Modify.html b/share/html/Ticket/Modify.html
index bc42f7e..6ed5eaa 100644
--- a/share/html/Ticket/Modify.html
+++ b/share/html/Ticket/Modify.html
@@ -70,16 +70,16 @@
 my $TicketObj = LoadTicket($id);
 my $CustomFields = $TicketObj->CustomFields;
 
-# call this to show up hints of valid cf values.
+# Now let callbacks have a chance at editing %ARGS
+$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS );
+
 $m->comp(
     '/Elements/ValidateCustomFields',
+    Object       => $TicketObj,
     CustomFields => $CustomFields,
-    ARGSRef => {},
+    ARGSRef      => \%ARGS,
 );
 
-# Now let callbacks have a chance at editing %ARGS
-$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS );
-
 my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
 push @results, ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS);
 
diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 5143925..3e204bb 100644
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -136,13 +136,6 @@
 my $Ticket = LoadTicket($id);
 my $CustomFields = $Ticket->CustomFields;
 
-# call this to show up hints of valid cf values.
-$m->comp(
-    '/Elements/ValidateCustomFields',
-    CustomFields => $CustomFields,
-    ARGSRef => {},
-);
-
 my $CanRespond = 0;
 my $CanComment = 0;
 
@@ -181,6 +174,14 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
 
 
 $m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS );
+
+$m->comp(
+    '/Elements/ValidateCustomFields',
+    Object       => $Ticket,
+    CustomFields => $CustomFields,
+    ARGSRef      => \%ARGS,
+);
+
 my @results;
 
 unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) {

commit 3f44e97021684c78fbd8eab38b56e3fabc6c2221
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 19:08:58 2012 -0800

    Skip all updates and provide better messages if CF validation fails
    
    The ticket Basics and Jumbo pages now skip all updates if CFs don't
    validate instead of partially updating and partially failing.  This
    requires preserving submitted values across requests for the basic core
    ticket fields (which previously were not preserved on error).  Both of
    these historically different pages now match the standard update page
    behaviour.
    
    These two pages were skipped over by bc25369 and 4c4e118.

diff --git a/share/html/Ticket/Modify.html b/share/html/Ticket/Modify.html
index 6ed5eaa..52bf096 100644
--- a/share/html/Ticket/Modify.html
+++ b/share/html/Ticket/Modify.html
@@ -56,7 +56,7 @@
 <input type="hidden" class="hidden" name="id" value="<% $TicketObj->Id %>" />
 
 <&| /Widgets/TitleBox, title => loc('Modify ticket #[_1]',$TicketObj->Id), class=>'ticket-info-basics' &>
-<& Elements/EditBasics, TicketObj => $TicketObj &>
+<& Elements/EditBasics, TicketObj => $TicketObj, defaults => \%ARGS &>
 <& /Elements/EditCustomFields, Object => $TicketObj, DefaultsFromTopArguments => 0, Grouping => 'Basics' &>
 </&>
 % $m->callback( CallbackName => 'AfterBasics', Ticket => $TicketObj );
@@ -70,20 +70,31 @@
 my $TicketObj = LoadTicket($id);
 my $CustomFields = $TicketObj->CustomFields;
 
+my @results;
+my $skip_update = 0;
+
 # Now let callbacks have a chance at editing %ARGS
-$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS );
+$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS, skip_update => \$skip_update );
 
-$m->comp(
-    '/Elements/ValidateCustomFields',
-    Object       => $TicketObj,
-    CustomFields => $CustomFields,
-    ARGSRef      => \%ARGS,
-);
+{
+    my ($status, @msg) = $m->comp(
+        '/Elements/ValidateCustomFields',
+        Object       => $TicketObj,
+        CustomFields => $CustomFields,
+        ARGSRef      => \%ARGS,
+    );
+    unless ($status) {
+        push @results, @msg;
+        $skip_update = 1;
+    }
+}
 
-my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
-push @results, ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS);
+unless ($skip_update) {
+    push @results, ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
+    push @results, ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS);
 
-$TicketObj->ApplyTransactionBatch;
+    $TicketObj->ApplyTransactionBatch;
+}
 
 unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {
     if (@results) {
diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 3e204bb..2d26ec7 100644
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -56,7 +56,7 @@
 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
 
 <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &>
-<& Elements/EditBasics, TicketObj => $Ticket &>
+<& Elements/EditBasics, TicketObj => $Ticket, defaults => \%ARGS &>
 <& /Elements/EditCustomFields, Object => $Ticket, Grouping => 'Basics' &>
 </&>
 
@@ -173,33 +173,38 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
 }
 
 
-$m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS );
-
-$m->comp(
-    '/Elements/ValidateCustomFields',
-    Object       => $Ticket,
-    CustomFields => $CustomFields,
-    ARGSRef      => \%ARGS,
-);
-
 my @results;
+my $skip_update = 0;
+$m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS, skip_update => \$skip_update );
+
+{
+    my ($status, @msg) = $m->comp(
+        '/Elements/ValidateCustomFields',
+        Object       => $Ticket,
+        CustomFields => $CustomFields,
+        ARGSRef      => \%ARGS,
+    );
+    unless ($status) {
+        push @results, @msg;
+        $skip_update = 1;
+    }
+}
 
-unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) {
-    # There might be two owners. 
-    if ( ref ($ARGS{'Owner'} )) {
-        my @owners =@{$ARGS{'Owner'}};
-        delete $ARGS{'Owner'};
-        foreach my $owner(@owners){
-            if (defined($owner) && $owner =~ /\D/) {
-                $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->Name eq $owner);
-            }
-            elsif (length $owner) {
-                $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
-            }
+# There might be two owners.
+if ( ref ($ARGS{'Owner'} )) {
+    my @owners =@{$ARGS{'Owner'}};
+    delete $ARGS{'Owner'};
+    foreach my $owner(@owners){
+        if (defined($owner) && $owner =~ /\D/) {
+            $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->Name eq $owner);
+        }
+        elsif (length $owner) {
+            $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
         }
-
     }
+}
 
+unless ($skip_update or $OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) {
     push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
     push @results, ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS);
     push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
@@ -212,15 +217,15 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} )
 
     push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
     push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
-}
 
-$Ticket->ApplyTransactionBatch;
+    $Ticket->ApplyTransactionBatch;
 
-MaybeRedirectForResults(
-    Actions   => \@results,
-    Path      => "/Ticket/ModifyAll.html",
-    Arguments => { id => $Ticket->id },
-);
+    MaybeRedirectForResults(
+        Actions   => \@results,
+        Path      => "/Ticket/ModifyAll.html",
+        Arguments => { id => $Ticket->id },
+    );
+}
 
 # If they've gone and moved the ticket to somewhere they can't see, etc...
 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {

commit f96bb707cc4a4b652e867026dc80afe015dbf604
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 19:31:22 2012 -0800

    Failing tests demonstrating that required CFs block quick create

diff --git a/t/web/cf_pattern.t b/t/web/cf_pattern.t
index 6c73a93..a6fc199 100644
--- a/t/web/cf_pattern.t
+++ b/t/web/cf_pattern.t
@@ -23,6 +23,7 @@ ok $ticket && $ticket->id, "Created ticket";
 $m->login;
 
 for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->id) {
+    diag $page;
     $m->get_ok($page, "Fetched $page");
     $m->content_contains("Yaks");
     $m->content_contains("Input must match [Digits]");
@@ -55,5 +56,19 @@ for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->
     }
 }
 
+diag "Quick ticket creation";
+{
+    $m->get_ok("/");
+    $m->submit_form_ok({
+        with_fields => {
+            Subject     => "test quick create",
+            QuickCreate => 1,
+        },
+    });
+    my $tickets = RT::Tickets->new(RT->SystemUser);
+    $tickets->FromSQL("Subject = 'test quick create'");
+    is $tickets->Count, 0, "No ticket created";
+}
+
 undef $m;
 done_testing;

commit e93d90bc27ceaf9ad552298186036b60d4cb96e0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 19:32:34 2012 -0800

    Validate even unsubmitted CFs when quick creating
    
    Quick ticket creation relies on validating unsubmitted CFs to determine
    if quick create should be allowed or not.

diff --git a/share/html/Elements/ValidateCustomFields b/share/html/Elements/ValidateCustomFields
index 757611e..a79f643 100644
--- a/share/html/Elements/ValidateCustomFields
+++ b/share/html/Elements/ValidateCustomFields
@@ -58,7 +58,8 @@ while ( my $CF = $CustomFields->Next ) {
 
     # If we don't have a value and we don't see the Magic, then we're not
     # submitting a field.
-    next if not exists $submitted->{"Value"}
+    next if not $ValidateUnsubmitted
+        and not exists $submitted->{"Value"}
         and not exists $submitted->{"Values"}
         and not $submitted->{"Values-Magic"};
 
@@ -115,4 +116,5 @@ return wantarray? ($valid, @res): $valid;
 $Object => RT::Ticket->new( $session{'CurrentUser'})
 $CustomFields
 $ARGSRef
+$ValidateUnsubmitted => 0
 </%ARGS>
diff --git a/share/html/index.html b/share/html/index.html
index 523697b..15c346b 100644
--- a/share/html/index.html
+++ b/share/html/index.html
@@ -97,8 +97,9 @@ if ( $ARGS{'QuickCreate'} ) {
     
     my $ValidCFs = $m->comp(
         '/Elements/ValidateCustomFields',
-        CustomFields => $CFs,
-        ARGSRef => \%ARGS
+        CustomFields        => $CFs,
+        ARGSRef             => \%ARGS,
+        ValidateUnsubmitted => 1,
     );
 
 

commit 5ec13121aec049e3592d9366210b9473a5a68623
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 19:33:44 2012 -0800

    Improve the quick create "CFs required" error message
    
    Localizes the error with improved wording and grammar, and includes the
    validation error details so folks know what fields are required.

diff --git a/share/html/index.html b/share/html/index.html
index 15c346b..4735ca1 100644
--- a/share/html/index.html
+++ b/share/html/index.html
@@ -95,7 +95,7 @@ if ( $ARGS{'QuickCreate'} ) {
     
     my $CFs = $QueueObj->TicketCustomFields();
     
-    my $ValidCFs = $m->comp(
+    my ($ValidCFs, @msg) = $m->comp(
         '/Elements/ValidateCustomFields',
         CustomFields        => $CFs,
         ARGSRef             => \%ARGS,
@@ -122,11 +122,10 @@ if ( $ARGS{'QuickCreate'} ) {
                 Arguments => { id => $t->Id },
             );
         }
-
     }
     elsif ( !$ValidCFs ) {
-        push @results, "can't quickly create ticket in queue " .
-            $QueueObj->Name . ' because some custom fields need to be set, please go to normal ticket creation page to do that.';
+        push @results, loc("Can't quickly create ticket in queue [_1] because custom fields are required.  Please use the normal ticket creation page.", $QueueObj->Name);
+        push @results, @msg;
     }
     MaybeRedirectForResults(
         Actions   => \@results,

commit 8353dfc068c598df6af41fcf44a5c830301f86bc
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 19:51:22 2012 -0800

    Redirect to the full ticket create page instead of erroring when CFs are required
    
    It's much more friendly to simply redirect users to the page they need
    to be on, with their already submitted data prefilled.  This lets them
    just fill in the few required CFs and go on their way as quickly as
    possible (which is the whole point of quick create anyway!).

diff --git a/share/html/index.html b/share/html/index.html
index 4735ca1..066252b 100644
--- a/share/html/index.html
+++ b/share/html/index.html
@@ -124,8 +124,23 @@ if ( $ARGS{'QuickCreate'} ) {
         }
     }
     elsif ( !$ValidCFs ) {
-        push @results, loc("Can't quickly create ticket in queue [_1] because custom fields are required.  Please use the normal ticket creation page.", $QueueObj->Name);
+        push @results, loc("Can't quickly create ticket in queue [_1] because custom fields are required.  Please finish by using the normal ticket creation page.", $QueueObj->Name);
         push @results, @msg;
+
+        MaybeRedirectForResults(
+            Actions     => \@results,
+            Path        => "/Ticket/Create.html",
+            Arguments   => {
+                (map { $_ => $ARGS{$_} } qw(Queue Owner Status Content Subject)),
+                Requestors => $ARGS{Requestors},
+                # From is set above when CFs are OK, but not here since we're
+                # not calling CreateTicket() directly.  The proper place to set
+                # a default for From, if desired in the future, is in
+                # CreateTicket() itself, or at least /Ticket/Display.html
+                # (which processes /Ticket/Create.html).  From is rarely used
+                # overall.
+            },
+        );
     }
     MaybeRedirectForResults(
         Actions   => \@results,

commit 918a3ad970254644551da907bf5ebcc38b36ffcf
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 20:16:58 2012 -0800

    Tests: Reload the page in each loop to avoid leftover values
    
    Form values now persist on the Basics page (3f44e97).

diff --git a/t/web/cf_groupings.t b/t/web/cf_groupings.t
index 73a07e5..36c2345 100644
--- a/t/web/cf_groupings.t
+++ b/t/web/cf_groupings.t
@@ -73,10 +73,11 @@ my $id = $m->get_ticket_id;
     note "testing Basics/People/Dates/Links pages";
     my $prefix = 'Object-RT::Ticket-'. $id .'-CustomField:';
     { # Basics and More both show up on "Basics"
-        $m->follow_link_ok({id => 'page-basics'}, 'Ticket -> Basics');
-        is $m->dom->find(qq{input[name^="$prefix"][name\$="-Value"]})->size, 2,
-            "two CF inputs on the page";
         for my $name (qw/Basics More/) {
+            $m->follow_link_ok({id => 'page-basics'}, 'Ticket -> Basics');
+            is $m->dom->find(qq{input[name^="$prefix"][name\$="-Value"]})->size, 2,
+                "two CF inputs on the page";
+
             my $input_name = "$prefix$name-$CF{$name}-Value";
             ok $m->dom->at(qq{$location{$name} input[name="$input_name"]}),
                 "CF is in the right place";

commit f746f5cf346416c9ff6e4459e90f45d7055c34e3
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 24 20:18:16 2012 -0800

    Tests: Ensure we're matching the result messages not CF hints
    
    CF hints added in c5fe1cb could provide false positives.

diff --git a/t/web/cf_groupings.t b/t/web/cf_groupings.t
index 36c2345..a59cd99 100644
--- a/t/web/cf_groupings.t
+++ b/t/web/cf_groupings.t
@@ -91,7 +91,7 @@ my $id = $m->get_ticket_id;
                 with_fields => { $input_name => "bad value" },
                 button      => 'SubmitTicket',
             });
-            $m->content_like(qr{Input must match});
+            $m->content_like(qr{Test\Q$name\E: Input must match});
         }
     }
 
@@ -111,7 +111,7 @@ my $id = $m->get_ticket_id;
             with_fields => { $input_name => "bad value" },
             button      => 'SubmitTicket',
         });
-        $m->content_like(qr{Input must match});
+        $m->content_like(qr{Could not add new custom field value: Input must match});
     }
 }
 

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


More information about the Rt-commit mailing list