5 use RT::Test tests => 20;
7 my $plain = MIME::Entity->build(
8 Subject => 'plain mime',
11 If you have some problems with RT you could find help
12 on http://wiki.bestpractical.com or subscribe to
13 the rt-users\@lists.bestpractical.com.
16 https://wiki.bestpractical.com/test#anchor
18 Best regards. BestPractical Team.
22 my $html = MIME::Entity->build(
24 Subject => 'html mime',
26 If you have some problems with RT you could find help
27 on <a href="http://wiki.bestpractical.com">wiki</a>
28 or find known bugs on http://rt3.fsck.com
31 https://wiki.bestpractical.com/test#anchor
33 Best regards. BestPractical Team.
38 my $ticket = RT::Ticket->new( RT->SystemUser );
40 my ($plain_id) = $ticket->Create(
45 ok($plain_id, "We created a ticket #$plain_id");
47 my ($html_id) = $ticket->Create(
52 ok($html_id, "We created a ticket #$html_id");
54 diag 'test no clicky';
56 RT->Config->Set( 'Active_MakeClicky' => () );
57 my ( $baseurl, $m ) = RT::Test->started_ok;
58 ok $m->login, 'logged in';
59 $m->goto_ticket($plain_id);
61 my @links = $m->find_link(
63 url => 'http://wiki.bestpractical.com',
65 ok( @links == 0, 'no clicky link found with plain message' );
67 @links = $m->find_link(
69 url => 'http://rt3.fsck.com',
71 ok( @links == 0, 'no extra clicky link found with html message' );
76 RT::Test->stop_server;
77 RT->Config->Set( 'Active_MakeClicky' => qw/httpurl/ );
78 my ( $baseurl, $m ) = RT::Test->started_ok;
79 ok $m->login, 'logged in';
80 $m->goto_ticket($plain_id);
82 my @links = $m->find_link(
84 url => 'http://wiki.bestpractical.com',
87 ok( scalar @links, 'found clicky link' );
89 @links = $m->find_link(
91 url => 'https://wiki.bestpractical.com/test#anchor',
94 ok( scalar @links, 'found clicky link with anchor' );
96 $m->goto_ticket($html_id);
97 @links = $m->find_link(
99 url => 'http://wiki.bestpractical.com',
102 ok( @links == 0, 'not make clicky links clicky twice' );
104 @links = $m->find_link(
106 url => 'http://rt3.fsck.com',
109 ok( scalar @links, 'found clicky link' );
111 @links = $m->find_link(
113 url => 'https://wiki.bestpractical.com/test#anchor',
116 ok( scalar @links, 'found clicky link with anchor' );
119 diag 'test httpurl_overwrite';
121 RT::Test->stop_server;
122 RT->Config->Set( 'Active_MakeClicky' => 'httpurl_overwrite' );
123 my ( $baseurl, $m ) = RT::Test->started_ok;
124 ok $m->login, 'logged in';
125 ok $m->goto_ticket($plain_id), 'opened diplay page of the ticket';
127 my @links = $m->find_link(
129 url => 'http://wiki.bestpractical.com',
130 text => 'http://wiki.bestpractical.com',
132 ok( scalar @links, 'found clicky link' );
134 @links = $m->find_link(
136 url => 'https://wiki.bestpractical.com/test#anchor',
137 text => 'https://wiki.bestpractical.com/test#anchor',
139 ok( scalar @links, 'found clicky link with anchor' );