[Rt-commit] [svn] r881 - in RT-Client: . t

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Wed May 12 21:59:21 EDT 2004


Author: autrijus
Date: Wed May 12 21:59:20 2004
New Revision: 881

Modified:
   RT-Client/   (props changed)
   RT-Client/MANIFEST
   RT-Client/META.yml
   RT-Client/t/1-procedural.t
Log:
 ----------------------------------------------------------------------
 r4824 at not:  autrijus | 2004-05-13T01:59:07.897451Z
 
 * all specs passed save for 1.4 and 1.5.
 ----------------------------------------------------------------------


Modified: RT-Client/MANIFEST
==============================================================================
--- RT-Client/MANIFEST	(original)
+++ RT-Client/MANIFEST	Wed May 12 21:59:20 2004
@@ -11,9 +11,18 @@
 inc/Module/Install/Scripts.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
+lib/LWP/Authen/Wsse.pm
+lib/LWP/UserAgent/AtomClient.pm
 lib/RT/Client.pm
+lib/RT/Client/Base.pm
+lib/RT/Client/Container.pm
+lib/RT/Client/Object.pm
+lib/RT/Client/Property.pm
+lib/RT/Client/ResultSet.pm
 Makefile.PL
 MANIFEST
 MANIFEST.SKIP
 META.yml
 SIGNATURE
+t/1-procedural.t
+t/spec.t

Modified: RT-Client/META.yml
==============================================================================
--- RT-Client/META.yml	(original)
+++ RT-Client/META.yml	Wed May 12 21:59:20 2004
@@ -9,6 +9,7 @@
   HTTP::Request::Common: 0
   XML::Atom: 0.05
   Spiffy: 0.16
+  Filter::Include: 1.4
 no_index:
   directory:
     - inc

Modified: RT-Client/t/1-procedural.t
==============================================================================
--- RT-Client/t/1-procedural.t	(original)
+++ RT-Client/t/1-procedural.t	Wed May 12 21:59:20 2004
@@ -85,61 +85,49 @@
 is(length($rt->get("$uri.Subject")), 4, 'retrieved with GBK encoding');
 $rt->encoding('UTF-8');
 
-exit;
-__END__
-# 1.4 Ability to set values in n existing custom fields.
-
-my $cf = $queue->CustomFields->add(
-    Name => 'CFTest',
-    Type => 'SelectSingle',
-);
-
-$cf->addValues( Name => 'foo', Description => 'Foo Option' );
+=begin TODO
 
+# 1.4 Ability to set values in n existing custom fields.
 # 1.5 Ability to set values in "Select One Value" and "Enter One Value"
-# -type custom fields
-
-# RT-Tickets/5/CustomFieldValues/9/1.Content
-# RT-Tickets/5/CustomFieldValues/9/1.Content
-$ticket->CustomFieldValues($cf)->set( Content => 'foo');
 
-is($ticket->CustomFieldsValues($cf)->count, 1);
-is($ticket->CustomFieldsValues($cf)->first->Content, 'foo');
+=cut
 
 # 1.6 For modifications, need to identify ticket number. We'd prefer to
 # identify modifying user as well if possible.
 
-my $id = $ticket->Id;
-$rt->current_user('Nobody');
-is($ticket->_current_user, $rt->current_user, '->_current_user is global');
-$rt->Tickets($id)->comment( Content => "Hello!" );
+$rt->current_user('RT_System');
+my $id = $rt->get("$uri.Id");
+is($rt->set("Tickets/$id.Subject", 'set by system'), 'set by system');
+my $sys_id = $rt->get("Users/RT_System.Id");
+is($rt->get("Tickets/$id/Transactions/*-1.Creator"), $sys_id, 'set by system');
 $rt->current_user($rt->username);
 
 # 2. Ability to Close a Ticket via an External Interface
 
-$ticket->setStatus('resolved');
+is($rt->set("$uri.Status", 'resolved'), 'resolved');
+is($rt->get("$uri.Status"), 'resolved');
+my $root_id = $rt->get("Users/root.Id");
+is($rt->get("$uri/Transactions/*-1.Creator"), $root_id, 'set by root');
+is($rt->set("$uri.Status", 'open'), 'open');
 
 # 2.1 Ability to close a ticket based on ticket number. We'd prefer to
 # identify closing user as well if possible.
 
-$ticket->current_user('Nobody');
-$ticket->comment( Content => 'reopen!' );
-is($ticket->Status, 'open');
-$ticket->setStatus('resolved');
-$ticket->current_user($rt->username);
+$rt->current_user('RT_System');
+is($rt->set("Tickets/$id.Status", 'resolved'), 'resolved');
+is($rt->get("Tickets/$id/Transactions/*-1.Creator"), $sys_id, 'set by system');
+$rt->current_user($rt->username);
 
 # 3. General CLI Requirements
 
 # 3.1 Error Responses: CLI must return status and error responses
 # instead of end-user help text.
 
-$ticket->setStatus('open');
-is($rt->_status, 200);
-is($ticket->_status, 200);
-$ticket->setOwner('no_such_user' . rand());
-is($rt->_status, 200);
-is($ticket->_status, 400);
-isnt($ticket->_errstr, undef);
+is($rt->set("$uri.Status", 'open'), 'open');
+is($rt->status, 200);
+is($rt->set("$uri.Owner", 'no_such_user'.rand()), undef);
+is($rt->status, 400);
+isnt($rt->errstr, undef, 'errstr is '.$rt->errstr);
 
 # 3.2 Environment: Support perl 5.6.1.
 


More information about the Rt-commit mailing list