File: quicksearch.t

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,216 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,412; makefile: 487; python: 37; php: 15
file content (50 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use strict;
use warnings;

use RT::Test tests => 9;
my ($baseurl, $m) = RT::Test->started_ok;
my $url = $m->rt_base_url;

# merged tickets still show up in search
my $t1 = RT::Ticket->new(RT->SystemUser);
$t1->Create(
    Subject   => 'base ticket'.$$,
    Queue     => 'general',
    Owner     => 'root',
    Requestor => 'customsearch@localhost',
    MIMEObj   => MIME::Entity->build(
        From    => 'customsearch@localhost',
        To      => 'rt@localhost',
        Subject => 'base ticket'.$$,
        Data    => "DON'T SEARCH FOR ME",
    ),
);
ok(my $id1 = $t1->id, 'created ticket for custom search');

my $t2 = RT::Ticket->new(RT->SystemUser);
$t2->Create(
    Subject   => 'merged away'.$$,
    Queue     => 'general',
    Owner     => 'root',
    Requestor => 'customsearch@localhost',
    MIMEObj   => MIME::Entity->build(
        From    => 'customsearch@localhost',
        To      => 'rt@localhost',
        Subject => 'merged away'.$$,
        Data    => "MERGEDAWAY",
    ),
);
ok(my $id2 = $t2->id, 'created ticket for custom search');

my ($ok, $msg) = $t2->MergeInto($id1);
ok($ok, "merge: $msg");

ok($m->login, 'logged in');

$m->form_with_fields('q');
$m->field(q => 'fulltext:MERGEDAWAY');
TODO:  {
    local $TODO = "We don't yet handle merged ticket content searches right";
$m->content_contains('<h1>Found 1 ticket</h1>');
}
$m->content_contains('base ticket', "base ticket is found, not the merged-away ticket");