~ubuntu-branches/ubuntu/oneiric/request-tracker3.8/oneiric-updates

« back to all changes in this revision

Viewing changes to t/api/condition-reject.t

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves, Dominic Hargreaves, Christian Perrier
  • Date: 2009-06-16 21:46:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090616214659-5ji9k1n3qyc2br3n
Tags: 3.8.4-1
[ Dominic Hargreaves ]
* Add missing comma in Depends (fixes FTBFS on etch)
* Update debconf translations: pt.po, ja.po, sv.po, it.po, cs.po, ru.po
  (Closes: #519885, #519922, #520603, #520759, #521199, #521926)
* Document preference for not using SQLite in production
  (Closes: #512750)

[ Christian Perrier ]
* Debconf templates and debian/control reviewed by the debian-l10n-
  english team as part of the Smith review project.
  (Closes: #522367, #520959)
* [Debconf translation updates]
  - Japanese. Closes: #522896
  - German. Closes: #520958
  - Portuguese. Closes: #523481
  - Galician. Closes: #524256
  - Galician. Closes: #524256
  - Spanish. Closes: #524449
  - Italian. Closes: #524715
  - Russian. Closes: #524894
  - Swedish. Closes: #525171
  - French. Closes: #525281

[ Dominic Hargreaves ]
* Don't tell dbconfig to comment out unused variables, since this
  breaks MySQL and Postgres database configuration (Closes: #523090)
* Update Standards-Version (no changes)
* Switch dependency on sysklogd to rsyslog (Closes: #526914)
* New upstream release; includes
  - Minor security fix (Closes: #533069)
  - Add missing Postgres index (Closes: #512653)
* Patch webmux.pl to provide a better error message when the wrong
  major version of RT is in @INC (for example in a mod_perl context).
  (Closes: #518692)
* Add some more example Exim 4 configuration (Closes: #238345)
* Don't apply database ACLs in databases managed by dbconfig-common.
* Remove unused ACL patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Check that the "On Reject" scrip condition exists and is working
 
3
#
 
4
 
 
5
use strict;
 
6
use warnings;
 
7
use Test::More; 
 
8
plan tests => 7;
 
9
use RT;
 
10
use RT::Test;
 
11
 
 
12
 
 
13
{
 
14
 
 
15
my $q = RT::Queue->new($RT::SystemUser);
 
16
$q->Create(Name =>'rejectTest');
 
17
 
 
18
ok($q->Id, "Created a scriptest queue");
 
19
 
 
20
my $s1 = RT::Scrip->new($RT::SystemUser);
 
21
my ($val, $msg) =$s1->Create( Queue => $q->Id,
 
22
             ScripAction => 'User Defined',
 
23
             ScripCondition => 'On reject',
 
24
             CustomIsApplicableCode => '',
 
25
             CustomPrepareCode => 'return 1',
 
26
             CustomCommitCode => '
 
27
                    $self->TicketObj->SetPriority($self->TicketObj->Priority+1);
 
28
                return(1);
 
29
            ',
 
30
             Template => 'Blank'
 
31
    );
 
32
ok($val,$msg);
 
33
 
 
34
my $ticket = RT::Ticket->new($RT::SystemUser);
 
35
my ($tv,$ttv,$tm) = $ticket->Create(Queue => $q->Id,
 
36
                                    Subject => "hair on fire",
 
37
                                    InitialPriority => '20'
 
38
                                    );
 
39
ok($tv, $tm);
 
40
ok($ticket->SetStatus('rejected'), "Status set to \"rejected\"");
 
41
is ($ticket->Priority , '21', "Condition is true, scrip triggered");
 
42
ok($ticket->SetStatus('open'), "Status set to \"open\"");
 
43
is ($ticket->Priority , '21', "Condition is false, scrip skipped");
 
44
 
 
45
}
 
46
 
 
47
1;