[Rt-commit] rt branch, 4.0/flesh-out-jumbo-tests, created. rt-4.0.4-146-g631240e
Jason May
jasonmay at bestpractical.com
Thu Dec 22 18:30:15 EST 2011
The branch, 4.0/flesh-out-jumbo-tests has been created
at 631240eb7be0981579b7a3e9bae74ace14d260b8 (commit)
- Log -----------------------------------------------------------------
commit d0b57a796591e85d48b470737a97cd3190e4e588
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Dec 9 17:31:06 2011 +0400
check radio that reflects the current status of approval
don't show 'no action' if approval is already accepted
or denied. treat deleted and rejected statuses as denied.
diff --git a/share/html/Approvals/Elements/Approve b/share/html/Approvals/Elements/Approve
index f651139..0e086a6 100755
--- a/share/html/Approvals/Elements/Approve
+++ b/share/html/Approvals/Elements/Approve
@@ -67,17 +67,29 @@
<div class="form">
<div class="action">
<div>
+% if ( $inactive && $status eq 'resolved' ) {
+ <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-approve" name="Approval-<%$ticket->Id%>-Action" value="approve" checked="checked" />
+ <label for="Approval-<%$ticket->Id%>-Action-approve"><% loc('[_1] (Unchanged)', loc('Approve')) %></label>
+% } else {
<input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-approve" name="Approval-<%$ticket->Id%>-Action" value="approve" />
<label for="Approval-<%$ticket->Id%>-Action-approve"><&|/l&>Approve</&></label>
+% }
</div>
<div>
+% if ( $inactive && $status ne 'resolved' ) {
+ <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-deny" name="Approval-<%$ticket->Id%>-Action" value="deny" checked="checked" />
+ <label for="Approval-<%$ticket->Id%>-Action-deny"><% loc('[_1] (Unchanged)', loc('Deny')) %></label>
+% } else {
<input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-deny" name="Approval-<%$ticket->Id%>-Action" value="deny" />
<label for="Approval-<%$ticket->Id%>-Action-deny"><&|/l&>Deny</&></label>
+% }
</div>
+% unless ( $inactive ) {
<div>
<input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-none" name="Approval-<%$ticket->Id%>-Action" value="none" checked="checked" />
<label for="Approval-<%$ticket->Id%>-Action-none"><&|/l&>No action</&></label>
</div>
+% }
</div>
<div class="notes">
<label for="Approval-<%$ticket->Id%>-Notes"><&|/l&>Notes</&></label>
@@ -92,3 +104,7 @@ $ShowCustomFields => 1
$ShowHistory => 1
$ticket => undef
</%ARGS>
+<%INIT>
+my $status = $ticket->Status;
+my $inactive = $ticket->QueueObj->Lifecycle->IsInactive( $status );
+</%INIT>
diff --git a/share/html/Approvals/index.html b/share/html/Approvals/index.html
index fc04fce..f1002c9 100755
--- a/share/html/Approvals/index.html
+++ b/share/html/Approvals/index.html
@@ -79,11 +79,11 @@ foreach my $arg ( keys %ARGS ) {
}
my ($val, $msg);
- if ( $ARGS{$arg} eq 'deny' ) {
- ( $val, $msg ) = $ticket->SetStatus('rejected');
+ if ( $ARGS{$arg} eq 'deny' && $ticket->Status !~ /^(rejected|deleted)/ ) {
+ ( $val, $msg ) = $ticket->SetStatus('rejected');
}
- elsif ( $ARGS{$arg} eq 'approve' ) {
- ( $val, $msg ) = $ticket->SetStatus('resolved');
+ elsif ( $ARGS{$arg} eq 'approve' && $ticket->Status ne 'resolved') {
+ ( $val, $msg ) = $ticket->SetStatus('resolved');
}
push ( @actions, loc("Approval #[_1]: [_2]",$ticket->id, $msg )) if ($msg);
}
commit b481f249dcbec506a8f16da7fd3b95ce481ae387
Author: Jason May <jasonmay at bestpractical.com>
Date: Wed Dec 21 17:26:08 2011 -0500
Test ticket date submissions in Jumbo
diff --git a/t/web/ticket_modify_all.t b/t/web/ticket_modify_all.t
index c9dd7e7..9e077c2 100644
--- a/t/web/ticket_modify_all.t
+++ b/t/web/ticket_modify_all.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => 15;
+use RT::Test tests => 20;
my $ticket = RT::Test->create_ticket(
Subject => 'test bulk update',
@@ -40,5 +40,26 @@ $m->click('SubmitTicket');
$m->form_name('TicketModifyAll');
is($m->value('Owner'), 'root', 'owner was successfully changed to root');
-# XXX TODO test other parts, i.e. basic, dates, people and links
+$m->get_ok($url . "/Ticket/ModifyAll.html?id=" . $ticket->id);
+$m->form_name('TicketModifyAll');
+$m->field('Starts_Date' => "2013-01-01 00:00:00");
+$m->click('SubmitTicket');
+$m->text_contains("Starts: (Tue Jan 01 00:00:00 2013)", 'start date successfully updated');
+
+$m->form_name('TicketModifyAll');
+$m->field('Started_Date' => "2014-01-01 00:00:00");
+$m->click('SubmitTicket');
+$m->text_contains("Started: (Wed Jan 01 00:00:00 2014)", 'started date successfully updated');
+
+$m->form_name('TicketModifyAll');
+$m->field('Told_Date' => "2015-01-01 00:00:00");
+$m->click('SubmitTicket');
+$m->text_contains("Last Contact: (Thu Jan 01 00:00:00 2015)", 'told date successfully updated');
+
+$m->form_name('TicketModifyAll');
+$m->field('Due_Date' => "2016-01-01 00:00:00");
+$m->click('SubmitTicket');
+$m->text_contains("Due: (Fri Jan 01 00:00:00 2016)", 'due date successfully updated');
+
+# XXX TODO test other parts, i.e. people and links
commit 631240eb7be0981579b7a3e9bae74ace14d260b8
Author: Jason May <jasonmay at bestpractical.com>
Date: Thu Dec 22 18:26:41 2011 -0500
Test adding watchers in Jumbo
diff --git a/t/web/ticket_modify_all.t b/t/web/ticket_modify_all.t
index 9e077c2..224f4d1 100644
--- a/t/web/ticket_modify_all.t
+++ b/t/web/ticket_modify_all.t
@@ -62,4 +62,22 @@ $m->field('Due_Date' => "2016-01-01 00:00:00");
$m->click('SubmitTicket');
$m->text_contains("Due: (Fri Jan 01 00:00:00 2016)", 'due date successfully updated');
-# XXX TODO test other parts, i.e. people and links
+$m->get( $url . '/Ticket/ModifyAll.html?id=' . $ticket->id );
+$m->form_name('TicketModifyAll');
+$m->field(WatcherTypeEmail => 'Requestor');
+$m->field(WatcherAddressEmail => 'root at localhost');
+$m->click('SubmitTicket');
+$m->text_contains(
+ "Added principal as a Requestor for this ticket",
+ 'watcher is added',
+);
+$m->form_name('TicketModifyAll');
+$m->field(WatcherTypeEmail => 'Requestor');
+$m->field(WatcherAddressEmail => 'root at localhost');
+$m->click('SubmitTicket');
+$m->text_contains(
+ "That principal is already a Requestor for this ticket",
+ 'no duplicate watchers',
+);
+
+# XXX TODO test other parts, i.e. links
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list