diff options
author | ivan <ivan> | 2007-08-01 22:20:33 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-08-01 22:20:33 +0000 |
commit | 32b5d3a31f112a381f0a15ac5e3a2204242f3405 (patch) | |
tree | 53c5336f52b08e47d8b3be4df20b50560414c590 /rt/lib/t | |
parent | 52af7f398d81a374ec63e12b67ac7938fe1e6dac (diff) |
commit these RT differences, seem to be mostly in autogen'ed stuff
Diffstat (limited to 'rt/lib/t')
-rw-r--r-- | rt/lib/t/02regression.t | 7 | ||||
-rw-r--r-- | rt/lib/t/03web.pl | 78 | ||||
-rw-r--r-- | rt/lib/t/04_send_email.pl | 25 |
3 files changed, 107 insertions, 3 deletions
diff --git a/rt/lib/t/02regression.t b/rt/lib/t/02regression.t index 4504cc76a..4cc131815 100644 --- a/rt/lib/t/02regression.t +++ b/rt/lib/t/02regression.t @@ -34,11 +34,14 @@ is($q2->CommentAddress, 'comment@a'); use File::Find; -File::Find::find({wanted => \&wanted_autogen}, 'lib/t/autogen'); +File::Find::find({wanted => \&wanted_autogen, + preprocess => sub {return sort @_}}, 'lib/t/autogen'); sub wanted_autogen { /^autogen.*\.t\z/s && require $_; } -File::Find::find({wanted => \&wanted_regression}, 'lib/t/regression'); +File::Find::find({wanted => \&wanted_regression, + preprocess => sub {return sort @_}}, 'lib/t/regression'); sub wanted_regression { /^*\.t\z/s && require $_; } require "/opt/rt3/lib/t/03web.pl"; require "/opt/rt3/lib/t/04_send_email.pl"; +require "/opt/rt3/lib/t/05cronsupport.pl"; diff --git a/rt/lib/t/03web.pl b/rt/lib/t/03web.pl index 94ad3e97e..597ad109e 100644 --- a/rt/lib/t/03web.pl +++ b/rt/lib/t/03web.pl @@ -67,7 +67,83 @@ ok( $agent->{'content'} =~ qr{$string} , "Found the content"); # }}} +# {{{ Query Builder tests + +my $response = $agent->get($url."Search/Build.html"); +ok( $response->is_success, "Fetched " . $url."Search/Build.html" ); + +# Parsing TicketSQL +# +# Adding items + +# set the first value +ok($agent->form_name('BuildQuery')); +$agent->field("AttachmentField", "Subject"); +$agent->field("AttachmentOp", "LIKE"); +$agent->field("ValueOfAttachment", "aaa"); +$agent->submit(); + +# set the next value +ok($agent->form_name('BuildQuery')); +$agent->field("AttachmentField", "Subject"); +$agent->field("AttachmentOp", "LIKE"); +$agent->field("ValueOfAttachment", "bbb"); +$agent->submit(); + +ok($agent->form_name('BuildQuery')); + +# get the query +my $query = $agent->current_form->find_input("Query")->value; +# strip whitespace from ends +$query =~ s/^\s*//g; +$query =~ s/\s*$//g; + +# collapse other whitespace +$query =~ s/\s+/ /g; + +is ($query, "Subject LIKE 'aaa' AND Subject LIKE 'bbb'"); + +# - new items go one level down +# - add items at currently selected level +# - if nothing is selected, add at end, one level down +# +# move left +# - error if nothing selected +# - same item should be selected after move +# - can't move left if you're at the top level +# +# move right +# - error if nothing selected +# - same item should be selected after move +# - can always move right (no max depth...should there be?) +# +# move up +# - error if nothing selected +# - same item should be selected after move +# - can't move up if you're first in the list +# +# move down +# - error if nothing selected +# - same item should be selected after move +# - can't move down if you're last in the list +# +# toggle +# - error if nothing selected +# - change all aggregators in the grouping +# - don't change any others +# +# delete +# - error if nothing selected +# - delete currently selected item +# - delete all children of a grouping +# - if delete leaves a node with no children, delete that, too +# - what should be selected? +# +# Clear +# - clears entire query +# - clears it from the session, too +# }}} use File::Find; find ( \&wanted , 'html/'); @@ -83,7 +159,7 @@ sub test_get { $file =~ s#^html/##; ok ($agent->get("$url/$file", "GET $url/$file")); is ($agent->{'status'}, 200, "Loaded $file"); - ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file "); +# ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file "); ok( $agent->{'content'} !~ /Not logged in/i, "Still logged in for $file"); ok( $agent->{'content'} !~ /System error/i, "Didn't get a Mason compilation error on $file"); diff --git a/rt/lib/t/04_send_email.pl b/rt/lib/t/04_send_email.pl index c384eedfa..973d9d2e2 100644 --- a/rt/lib/t/04_send_email.pl +++ b/rt/lib/t/04_send_email.pl @@ -476,6 +476,31 @@ sub crashes_redef_sendmessage { # }}} +# {{{ test a multi-line RT-Send-CC header + +my $content = `cat /opt/rt3/lib/t/data/rt-send-cc` || die "couldn't find new content"; + +$parser->ParseMIMEEntityFromScalar($content); + + + +my %args = (message => $content, queue => 1, action => 'correspond'); + RT::Interface::Email::Gateway(\%args); +my $tickets = RT::Tickets->new($RT::SystemUser); +$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC'); +$tickets->Limit(FIELD => 'id' ,OPERATOR => '>', VALUE => '0'); +my $tick = $tickets->First(); +ok ($tick->Id, "found ticket ".$tick->Id); + +my $cc = $tick->Transactions->First->Attachments->First->GetHeader('RT-Send-Cc'); +ok ($cc =~ /test1/, "Found test 1"); +ok ($cc =~ /test2/, "Found test 2"); +ok ($cc =~ /test3/, "Found test 3"); +ok ($cc =~ /test4/, "Found test 4"); +ok ($cc =~ /test5/, "Found test 5"); + +# }}} + # Don't taint the environment $everyone->PrincipalObj->RevokeRight(Right =>'SuperUser'); 1; |