[Rt-commit] [rtir] 18/18: Start using __RTIRTicketURI__
Jesse Vincent
jesse at bestpractical.com
Wed Mar 11 03:36:49 EDT 2015
This is an automated email from the git hooks/post-receive script.
jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.
commit 20a2a1527338891ff69b04f8f3978e482545e1f1
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Wed Mar 11 00:27:25 2015 -0700
Start using __RTIRTicketURI__
Switch RTIR ticket URLs coming from collections to /RTIR/
---
etc/RTIR_Config.pm | 72 +++++++++++++++++++++++++--------------------------
lib/RT/IR/Test/Web.pm | 6 ++---
t/searches/menu.t | 55 +++++++++++++++++++++++++--------------
3 files changed, 75 insertions(+), 58 deletions(-)
diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index d9feb42..2278108 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -367,8 +367,8 @@ merged from this configuration. To change just the Investigation list you would
Set(%RTIRSearchResultFormats,
Default =>
- q{'<b><a HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a HREF="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__QueueName__,
__Status__,
__LastUpdatedRelative__,
@@ -376,32 +376,32 @@ Set(%RTIRSearchResultFormats,
__NEWLINE__,
'',__Requestors__,__OwnerName__,__ToldRelative__,__DueRelative__,__TimeLeft__},
ReportDefault =>
- q{'<b><a HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a HREF="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__LastUpdatedRelative__,
__CreatedRelative__,
__NEWLINE__,
'',__Requestors__,__OwnerName__,__ToldRelative__,__DueRelative__,__TimeLeft__},
InvestigationDefault =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__LastUpdatedRelative__,
__CreatedRelative__,
__NEWLINE__,
'', __Requestors__, __OwnerName__, __ToldRelative__, __DueRelative__, __TimeLeft__},
BlockDefault =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__LastUpdatedRelative__,
__CreatedRelative__,
__NEWLINE__,
'', __Requestors__, __OwnerName__, __ToldRelative__, __DueRelative__, __TimeLeft__},
IncidentDefault =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__LastUpdatedRelative__,
__CreatedRelative__,
@@ -410,71 +410,71 @@ Set(%RTIRSearchResultFormats,
'', '', __OwnerName__, __ToldRelative__, __DueRelative__, __TimeLeft__},
Merge =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Requestors__, __OwnerName__, __CreatedRelative__, __DueRelative__},
LinkChildren =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Requestors__, __OwnerName__, __CreatedRelative__, __DueRelative__},
LinkIncident =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__OwnerName__, __CreatedRelative__},
ListIncidents =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__},
RejectReports =>
- q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',
- '<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',
+ q{'<a href="__RTIRTicketURI__">__id__</a>/TITLE:#',
+ '<a href="__RTIRTicketURI__">__Subject__</a>/TITLE:Subject',
__HasIncident__, __Requestors__, __OwnerName__, __CreatedRelative__, __DueRelative__},
BulkReply =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__KeyRequestors__, __KeyOwnerName__, __CreatedRelative__, __DueRelative__},
DueIncidents =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__OwnerName__, __Priority__, __DueRelative__, __UpdateStatus__},
AbandonIncidents =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__OwnerName__, __Priority__, __DueRelative__},
NewReports =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Requestors__, __OwnerName__, __DueRelative__, __Take__},
ChildReport =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__DueRelative__},
ChildInvestigation =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__DueRelative__},
ChildBlock =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__DueRelative__},
LookupTool =>
- q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
- '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',
+ '<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',
__Status__,
__Priority__},
diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 9b37598..31c26e6 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -183,7 +183,7 @@ sub ticket_is_linked_to_inc {
foreach my $inc( ref $incs? @$incs : ($incs) ) {
my $desc = shift || "Ticket #$id is linked to the Incident #$inc";
$self->content_like(
- qr{Incident:\s*</td>\s*<td[^>]*?>.*?<td[^>]*?><b><a\s+href="/(?:RTIR|Ticket)/Display.html\?id=\Q$inc\E">\Q$inc\E</a></b></td>}ism,
+ qr{Incident:\s*</td>\s*<td[^>]*?>.*?<td[^>]*?><b><a\s+href="/RTIR/Incident/Display.html\?id=\Q$inc\E">\Q$inc\E</a></b></td>}ism,
$desc
) or return 0;
}
@@ -232,7 +232,7 @@ sub LinkChildToIncident {
# Check that the desired incident occurs in the list of available incidents; if not, keep
# going to the next page until you find it (or get to the last page and don't find it,
# whichever comes first)
- while($self->content() !~ m|<a href="/Ticket/Display.html\?id=$incident">$incident</a>|) {
+ while($self->content() !~ m|<a href="/RTIR/Display.html\?id=$incident">$incident</a>|) {
last unless $self->follow_link(text => 'Next');
}
@@ -360,7 +360,7 @@ sub bulk_abandon {
# going to the next page until you find it (or get to the last page and don't find it,
# whichever comes first)
while ( $self->content() !~
- qr{<a href="/Ticket/Display.html\?id=$to_abandon[0]">$to_abandon[0]</a>}
+ qr{<a href="/RTIR/Display.html\?id=$to_abandon[0]">$to_abandon[0]</a>}
)
{
last unless $self->follow_link( text => 'Next' );
diff --git a/t/searches/menu.t b/t/searches/menu.t
index 1421b5e..05985b4 100644
--- a/t/searches/menu.t
+++ b/t/searches/menu.t
@@ -27,8 +27,15 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
$m->follow_link_ok( { text => 'Merge' } );
$m->title_like(qr/Merge .+ #$ticket{$type}[0]:/);
- for my $id ( @{ $ticket{$type} }[ 1 .. 2 ] ) {
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$id$} ), "found link to $type $id" );
+ if ($type eq 'incident') {
+ for my $id ( @{ $ticket{$type} }[ 1 .. 2 ] ) {
+ ok( $m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$id$} ), "found link to $type $id" );
+ }
+ } else {
+ for my $id ( @{ $ticket{$type} }[ 1 .. 2 ] ) {
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$id$} ), "found link to $type $id" );
+ }
+
}
$m->follow_link_ok( { text => "Edit Search", $type eq 'incident' ? () : ( n => 2 ) } );
@@ -40,10 +47,20 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
},
"add new term 'id != $ticket{$type}[1]'"
);
- ok( !$m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[1]$} ),
+
+ if ($type eq 'incident') {
+ ok( !$m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{$type}[1]$} ),
"didn't find link to $type $ticket{$type}[1]" );
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[2]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{$type}[2]$} ),
"found link to $type $ticket{$type}[2]" );
+ } else {
+
+ ok( !$m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[1]$} ),
+ "didn't find link to $type $ticket{$type}[1]" );
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[2]$} ),
+ "found link to $type $ticket{$type}[2]" );
+ }
+
}
# Link ToIncident
@@ -53,10 +70,10 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
$m->follow_link_ok( { text => '[Link]' } );
$m->title_is("Link Report #$ticket{ir}[0] to selected Incident");
- ok( !$m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{incident}[0]$} ),
+ ok( !$m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{incident}[0]$} ),
"didn't find link to incident $ticket{incident}[0]" );
for my $incident_id ( @{ $ticket{incident} }[ 1 .. 2 ] ) {
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$incident_id$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$incident_id$} ),
"found link to incident $incident_id" );
}
@@ -72,9 +89,9 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
},
"add new term 'id != $ticket{incident}[1]'"
);
- ok( !$m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{incident}[1]$} ),
+ ok( !$m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{incident}[1]$} ),
"didn't find link to incident $ticket{incident}[1]" );
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{incident}[2]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{incident}[2]$} ),
"found link to incident $ticket{incident}[2]" );
}
@@ -86,13 +103,13 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
ok(
!$m->find_link(
- url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[0]$}
+ url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[0]$}
),
"didn't find link to incident report $ticket{ir}[0]"
);
for my $ir ( @{ $ticket{ir} }[ 1 .. 2 ] ) {
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ir$} ), "found link to incident report $ir" );
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ir$} ), "found link to incident report $ir" );
}
$m->follow_link_ok( { text => "Edit Search", n => 2 } );
@@ -114,12 +131,12 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
ok(
!$m->find_link(
- url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[1]$}
+ url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[1]$}
),
"didn't find link to incident report $ticket{ir}[1]"
);
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[2]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[2]$} ),
"found link to incident report $ticket{ir}[2]" );
}
@@ -129,11 +146,11 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
$m->follow_link_ok( { text => 'Reply to Reporters' } );
$m->title_like(qr/#$ticket{incident}[0]: Reply to Reporters/);
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[0]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[0]$} ),
"found link to incident report $ticket{ir}[0]" );
for my $type (qw/investigation block/) {
- ok( !$m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[0]$} ),
+ ok( !$m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
"didn't find link to $type $ticket{$type}[0]" );
}
@@ -153,7 +170,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
ok(
!$m->find_link(
- url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[0]$},
+ url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[0]$},
text => $ticket{ir}[0],
n => 2, # there is one in "Attach Reports" widget
),
@@ -161,7 +178,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
);
for my $type (qw/investigation block/) {
- ok( !$m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[0]$} ),
+ ok( !$m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
"didn't find link to $type $ticket{$type}[0]" );
}
}
@@ -173,7 +190,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
$m->title_like(qr/#$ticket{incident}[0]: Reply to All/);
for my $type (qw/ir investigation block/) {
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[0]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
"found link to $type $ticket{$type}[0]" );
}
$m->form_name('TicketUpdate');
@@ -198,7 +215,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
ok(
!$m->find_link(
- url_regex => qr{/Ticket/Display.html\?id=$ticket{ir}[0]$},
+ url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[0]$},
text => $ticket{ir}[0],
n => 2, # there is one in "Attach Reports" widget
),
@@ -206,7 +223,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
);
for my $type (qw/investigation block/) {
- ok( $m->find_link( url_regex => qr{/Ticket/Display.html\?id=$ticket{$type}[0]$} ),
+ ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
"found link to $type $ticket{$type}[0]" );
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list