[Rt-commit] r12632 - in rt/branches/3.8-TESTING: . t/web

elacour at bestpractical.com elacour at bestpractical.com
Fri May 23 04:43:12 EDT 2008


Author: elacour
Date: Fri May 23 04:43:11 2008
New Revision: 12632

Added:
   rt/branches/3.8-TESTING/share/html/Admin/Global/CustomFields/Queues.html
   rt/branches/3.8-TESTING/t/web/cf_onqueue.t
Modified:
   rt/branches/3.8-TESTING/   (props changed)

Log:
 r8931 at datura:  manu | 2008-05-23 10:42:45 +0200
 Miising two files on commit for the Queue Customfields support :(


Added: rt/branches/3.8-TESTING/share/html/Admin/Global/CustomFields/Queues.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/share/html/Admin/Global/CustomFields/Queues.html	Fri May 23 04:43:11 2008
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC 
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+    current_tab => "Admin/Global/CustomFields/Queues.html",
+    current_subtab => "Admin/Global/CustomFields/Queues.html",
+    Title => $title
+    &>
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object &>
+<%INIT>
+  my $title = loc( 'Edit Custom Fields for all queues');
+  my $object = RT::Queue->new($session{'CurrentUser'});
+</%INIT>

Added: rt/branches/3.8-TESTING/t/web/cf_onqueue.t
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/t/web/cf_onqueue.t	Fri May 23 04:43:11 2008
@@ -0,0 +1,67 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Test::More tests => 14;
+use RT::Test;
+my ($baseurl, $m) = RT::Test->started_ok;
+
+ok $m->login, 'logged in';
+
+diag "Create a queue CF" if $ENV{'TEST_VERBOSE'};
+{
+    $m->follow_link( text => 'Configuration' );
+    $m->title_is(q/RT Administration/, 'admin screen');
+    $m->follow_link( text => 'Custom Fields' );
+    $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
+    $m->follow_link( text => 'New custom field' );
+    $m->submit_form(
+        form_name => "ModifyCustomField",
+        fields => {
+            TypeComposite => 'Freeform-1',
+            LookupType => 'RT::Queue',
+            Name => 'QueueCFTest',
+            Description => 'QueueCFTest',
+        },
+    );
+    $m->content_like( qr/Object created/, 'CF QueueCFTest created' );
+}
+
+diag "Apply the new CF globally" if $ENV{'TEST_VERBOSE'};
+{
+    $m->follow_link( text => 'Global' );
+    $m->title_is(q!Admin/Global configuration!, 'global configuration screen');
+    $m->follow_link( url_regex => qr!Admin/Global/CustomFields/index! );
+    $m->title_is(q/Global custom field configuration/, 'global custom field configuration screen');
+    $m->follow_link( url => 'Queues.html' );
+    $m->title_is(q/Edit Custom Fields for all queues/, 'global custom field for all queues configuration screen');
+    $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on page' );
+    $m->submit_form(
+        form_name => "EditCustomFields",
+        fields => {
+            'Object--CF-1' => '1',
+        },
+    );
+    $m->content_like( qr/Object created/, 'CF QueueCFTest enabled globally' );
+}
+
+diag "Edit the CF value for default queue" if $ENV{'TEST_VERBOSE'};
+{
+    $m->follow_link( url => '/Admin/Queues/' );
+    $m->title_is(q/Admin queues/, 'queues configuration screen');
+    $m->follow_link( text => "1" );
+    $m->title_is(q/Editing Configuration for queue General/, 'default queue configuration screen');
+    $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on default queue' );
+    $m->submit_form(
+        form_number => 3,
+        # The following doesn't want to works :(
+        #with_fields => { 'Object-RT::Queue-1-CustomField-1-Value' },
+        fields => {
+            'Object-RT::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
+        },
+    );
+    $m->content_like( qr/QueueCFTest QueueCFTest content added/, 'Content filed in CF QueueCFTest for default queue' );
+
+}
+
+
+__END__


More information about the Rt-commit mailing list