[Rt-commit] rt branch, 4.4/shredder-user-uid, created. rt-4.4.3beta1-2-g9f4e4c1c0
Craig Kaiser
craig at bestpractical.com
Tue May 22 11:37:45 EDT 2018
The branch, 4.4/shredder-user-uid has been created
at 9f4e4c1c05c230b9f8754cf6c6e92b2ee54b2926 (commit)
- Log -----------------------------------------------------------------
commit 953868daf46226b409ceea20db343d4a3e79a70b
Author: Craig Kaiser <craig at bestpractical.com>
Date: Tue May 22 11:02:34 2018 -0400
Add test to hit shredder web UI
Test that the web UI loads and shreds a ticket successfully.
diff --git a/t/shredder/web.t b/t/shredder/web.t
new file mode 100644
index 000000000..52de6387f
--- /dev/null
+++ b/t/shredder/web.t
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+
+use Test::Deep;
+use RT::Test::Shredder tests => undef;
+
+my $test = "RT::Test::Shredder";
+my ( $baseurl, $agent ) = RT::Test->started_ok;
+# test a login
+{
+ $agent->login('root' => 'password');
+ # the field isn't named, so we have to click link 0
+ is( $agent->status, 200, "Fetched the page ok");
+ $agent->content_contains("Logout", "Found a logout link");
+}
+
+{
+ my $ticket = RT::Ticket->new( RT->SystemUser );
+ my ($id) = $ticket->Create( Subject => 'test', Queue => 1 );
+ ok( $id, "created new ticket" );
+ $ticket->ApplyTransactionBatch;
+ $agent->get($baseurl . '/Admin/Tools/Shredder/?Plugin=Tickets&Tickets%3Alimit=&Tickets%3Aquery=id%3D1&Tickets&WipeoutObject=RT%3A%3ATicket-example.com-1&Wipeout=Wipeout');
+ ok $agent;
+}
+done_testing();
commit 9f4e4c1c05c230b9f8754cf6c6e92b2ee54b2926
Author: Craig Kaiser <craig at bestpractical.com>
Date: Tue May 22 11:03:14 2018 -0400
Only check for Name on user objects for rt shredder
For CastObjectsToRecords in Shredder.pm do not want to check for Name
method unless the object provided is a user object
diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 8d99326b6..674ae4e9c 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -367,7 +367,7 @@ sub CastObjectsToRecords
if ( $id =~ /^\d+$/ && $id ne $obj->Id ){
die 'Loaded object id ' . $obj->Id . " is different from passed id $id";
}
- elsif ( $id ne $obj->Name ){
+ elsif ( $class eq 'RT::User' && $id ne $obj->Name ){
die 'Loaded object name ' . $obj->Name . " is different from passed name $id";
}
push @res, $obj;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list