fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / web / quicksearch.t
1 use strict;
2 use warnings;
3
4 use RT::Test tests => 9;
5 my ($baseurl, $m) = RT::Test->started_ok;
6 my $url = $m->rt_base_url;
7
8 # merged tickets still show up in search
9 my $t1 = RT::Ticket->new(RT->SystemUser);
10 $t1->Create(
11     Subject   => 'base ticket'.$$,
12     Queue     => 'general',
13     Owner     => 'root',
14     Requestor => 'customsearch@localhost',
15     MIMEObj   => MIME::Entity->build(
16         From    => 'customsearch@localhost',
17         To      => 'rt@localhost',
18         Subject => 'base ticket'.$$,
19         Data    => "DON'T SEARCH FOR ME",
20     ),
21 );
22 ok(my $id1 = $t1->id, 'created ticket for custom search');
23
24 my $t2 = RT::Ticket->new(RT->SystemUser);
25 $t2->Create(
26     Subject   => 'merged away'.$$,
27     Queue     => 'general',
28     Owner     => 'root',
29     Requestor => 'customsearch@localhost',
30     MIMEObj   => MIME::Entity->build(
31         From    => 'customsearch@localhost',
32         To      => 'rt@localhost',
33         Subject => 'merged away'.$$,
34         Data    => "MERGEDAWAY",
35     ),
36 );
37 ok(my $id2 = $t2->id, 'created ticket for custom search');
38
39 my ($ok, $msg) = $t2->MergeInto($id1);
40 ok($ok, "merge: $msg");
41
42 ok($m->login, 'logged in');
43
44 $m->form_with_fields('q');
45 $m->field(q => 'fulltext:MERGEDAWAY');
46 TODO:  {
47     local $TODO = "We don't yet handle merged ticket content searches right";
48 $m->content_contains('Found 1 ticket');
49 }
50 $m->content_contains('base ticket', "base ticket is found, not the merged-away ticket");