4 use RT::Test tests => 12;
6 my ($baseurl, $m) = RT::Test->started_ok;
7 ok($m->login, "Logged in");
9 my $queue = RT::Test->load_or_create_queue(Name => 'General');
10 ok($queue->Id, "loaded the General queue");
12 my $ticket = RT::Ticket->new($RT::SystemUser);
13 my ($tid, $txn, $msg) = $ticket->Create(
15 Subject => 'test links',
17 ok $tid, 'created a ticket #'. $tid or diag "error: $msg";
19 $m->goto_ticket($tid);
21 $m->follow_link_ok( { text => 'Links' }, "Followed link to Links" );
23 ok $m->form_with_fields("$tid-DependsOn"), "found the form";
24 my $not_a_ticket_url = "http://example.com/path/to/nowhere";
25 $m->field("$tid-DependsOn", $not_a_ticket_url);
26 $m->field("DependsOn-$tid", $not_a_ticket_url);
27 $m->field("$tid-MemberOf", $not_a_ticket_url);
28 $m->field("MemberOf-$tid", $not_a_ticket_url);
29 $m->field("$tid-RefersTo", $not_a_ticket_url);
30 $m->field("RefersTo-$tid", $not_a_ticket_url);
33 foreach my $type ("depends on", "member of", "refers to") {
34 $m->content_like(qr/$type.+$not_a_ticket_url/,"base for $type");
35 $m->content_like(qr/$not_a_ticket_url.+$type/,"target for $type");
38 $m->goto_ticket($tid);