Skip to content

Commit 91ae627

Browse files
Merge branch '6.0/update-investigation-tests'
2 parents 4f0c8d8 + d5835a4 commit 91ae627

44 files changed

Lines changed: 101 additions & 162 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

html/Callbacks/RTIR/Ticket/Create.html/BeforeCreate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ unless ($$skip_create) {
116116
results => $results,
117117
);
118118

119-
if ( $ARGSRef->{CreateWithInvestigation} ) {
119+
if ( $ARGSRef->{InvestigationSubmitTicket} ) {
120120
$$checks_failure_ref += RT::IR->FilterRTAddresses(
121121
ARGSRef => \%ARGS,
122122
Fields => {

html/RTIR/Incident/Create.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,4 @@
6060

6161
<%ARGS>
6262
$Title => loc("Create a new Incident")
63-
64-
$CreateWithInvestigation => 0
65-
$CreateIncident => $CreateWithInvestigation
66-
67-
$Split => undef
68-
69-
$Child => undef
7063
</%ARGS>

lib/RT/IR/Test/Web.pm

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ sub create_incident_and_investigation {
259259

260260
local $Test::Builder::Level = $Test::Builder::Level + 1;
261261

262-
if($ir_id) {
263-
$self->display_ticket( $ir_id );
262+
if ($ir_id) {
263+
$self->display_ticket($ir_id);
264+
264265
# Select the "New" link from the Display page
265-
$self->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link");
266+
$self->follow_link_ok( { id => "create-incident" }, "Followed 'New (Incident)' link" );
266267
}
267-
else
268-
{
269-
$self->goto_create_rtir_ticket('Incidents'.($constituency?' - '.$constituency : ''));
268+
else {
269+
$self->goto_create_rtir_ticket( 'Incidents' . ( $constituency ? ' - ' . $constituency : '' ) );
270270
}
271271

272272
# Fill out forms
@@ -277,9 +277,17 @@ sub create_incident_and_investigation {
277277
}
278278

279279
while (my ($f, $v) = each %$cfs) {
280-
$self->set_custom_field( 'Incidents'.($constituency ? ' - '.$constituency:''), $f, $v);
280+
if ( $f =~ s!Investigation!! ) {
281+
my $field_name
282+
= $self->custom_field_input( 'Investigations' . ( $constituency ? ' - ' . $constituency : '' ), $f )
283+
or next;
284+
$self->field( "Investigation$field_name", $v );
285+
}
286+
else {
287+
$self->set_custom_field( 'Incidents'.($constituency ? ' - '.$constituency:''), $f, $v);
288+
}
281289
}
282-
$self->click("CreateWithInvestigation");
290+
$self->click("InvestigationSubmitTicket");
283291
my $msg = $ir_id
284292
? "Attempting to create new incident and investigation linked to child $ir_id"
285293
: "Attempting to create new incident and investigation";

t/002-test-reject.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,4 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
169169
$agent->has_tag('a', "$id", 'we have link to ticket');
170170
}
171171

172-
undef $agent;
173172
done_testing;

t/003-resolve-IR-when-all-incidents-resolved.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ like(
4343

4444
ir_status('resolved');
4545

46-
undef $agent;
4746
done_testing;
4847

4948
sub ir_status {

t/005-resolve-investigations.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ like($agent->content, qr/Status changed from \S*open\S* to \S*resolved\S*/, "sit
3232
$agent->follow_link_ok({text => "Re-open"}, "Followed 'open' link");
3333
like($agent->content, qr/Status changed from \S*resolved\S* to \S*open\S*/, "site says ticket got re-opened");
3434

35-
undef $agent;
3635
done_testing;

t/006-saved-searches.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,4 @@ is($agent->value('SavedSearchOwner'), $DT_id, "privacy is correct");
7272

7373
# ... should also do tests for the RTIR "refine" thing, which is like QB.
7474

75-
undef $agent;
7675
done_testing;

t/009-attachments-processing.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,4 @@ $agent->goto_create_rtir_ticket('Countermeasures');
232232
unlink $filename or die "couldn't delete file '$filename': $!";
233233
}
234234

235-
undef $agent;
236235
done_testing;

t/010-bulk-reject.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,4 @@ foreach( @irs ) {
6565
$agent->ticket_status_is( $_, 'rejected', "Ticket #$_ is rejected" );
6666
}
6767

68-
undef $agent;
6968
done_testing;

t/011-merge.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,4 @@ diag "merge two IRs that are linked to different Incidents" if $ENV{'TEST_VERBOS
108108
$agent->ticket_is_linked_to_inc( $ir1_id, [$inc1_id, $inc2_id] );
109109
}
110110

111-
undef $agent;
112111
done_testing;

0 commit comments

Comments
 (0)