4 use RT::Test tests => undef;
6 my $ticket = RT::Test->create_ticket(
7 Subject => 'test bulk update',
11 RT->Config->Set(AutocompleteOwners => 1);
13 my ( $url, $m ) = RT::Test->started_ok;
14 ok( $m->login, 'logged in' );
16 $m->get_ok( $url . "/Ticket/ModifyAll.html?id=" . $ticket->id );
20 fields => { 'UpdateContent' => 'this is update content' },
21 button => 'SubmitTicket',
24 $m->content_contains("Comments added", 'updated ticket');
25 $m->content_lacks("this is update content", 'textarea is clear');
27 $m->get_ok($url . '/Ticket/Display.html?id=' . $ticket->id );
28 $m->content_contains("this is update content", 'updated content in display page');
30 $m->get_ok($url . '/Ticket/ModifyAll.html?id=' . $ticket->id);
32 $m->form_name('TicketModifyAll');
33 $m->field(Owner => 'root');
34 $m->click('SubmitTicket');
36 $m->form_name('TicketModifyAll');
37 is($m->value('Owner'), 'root', 'owner was successfully changed to root');
39 $m->get_ok($url . "/Ticket/ModifyAll.html?id=" . $ticket->id);
41 $m->form_name('TicketModifyAll');
42 $m->field('Starts_Date' => "2013-01-01 00:00:00");
43 $m->click('SubmitTicket');
44 $m->text_contains("Starts: (Tue Jan 01 00:00:00 2013)", 'start date successfully updated');
46 $m->form_name('TicketModifyAll');
47 $m->field('Started_Date' => "2014-01-01 00:00:00");
48 $m->click('SubmitTicket');
49 $m->text_contains("Started: (Wed Jan 01 00:00:00 2014)", 'started date successfully updated');
51 $m->form_name('TicketModifyAll');
52 $m->field('Told_Date' => "2015-01-01 00:00:00");
53 $m->click('SubmitTicket');
54 $m->text_contains("Last Contact: (Thu Jan 01 00:00:00 2015)", 'told date successfully updated');
56 for my $unset ("0", "-", " ") {
57 $m->form_name('TicketModifyAll');
58 $m->field('Due_Date' => "2016-01-01 00:00:00");
59 $m->click('SubmitTicket');
60 $m->text_contains("Due: (Fri Jan 01 00:00:00 2016)", 'due date successfully updated');
62 $m->form_name('TicketModifyAll');
63 $m->field('Due_Date' => $unset);
64 $m->click('SubmitTicket');
65 $m->text_contains("Due: (Not set)", "due date successfully cleared with '$unset'");
66 $m->warning_like(qr/Couldn't parse date '-'/) if $unset eq "-";
69 $m->get( $url . '/Ticket/ModifyAll.html?id=' . $ticket->id );
70 $m->form_name('TicketModifyAll');
71 $m->field(WatcherTypeEmail => 'Requestor');
72 $m->field(WatcherAddressEmail => 'root@localhost');
73 $m->click('SubmitTicket');
75 "Added root as a Requestor for this ticket",
78 $m->form_name('TicketModifyAll');
79 $m->field(WatcherTypeEmail => 'Requestor');
80 $m->field(WatcherAddressEmail => 'root@localhost');
81 $m->click('SubmitTicket');
83 "root is already a Requestor",
84 'no duplicate watchers',