[Rt-commit] rt branch, 4.4/download-user-info, repushed
Craig Kaiser
craig at bestpractical.com
Mon Jun 18 16:17:42 EDT 2018
The branch 4.4/download-user-info was deleted and repushed:
was 986f6063bf3f23e222e2d604de105f3ee9fd0189
now 0c7811fbb5dde5cf4575d01f0cf9c767a6cee5c4
1: a7061699c = 1: a7061699c Add column to transaction column map for content
2: 195b4b2a4 = 2: 195b4b2a4 Add 'UserDataSearchResultFormat' config option
3: fc4af63af = 3: fc4af63af Create helper for exporting user related information
4: 1720cfa35 = 4: 1720cfa35 Create portlet for downloading user information
5: 926302317 = 5: 926302317 Add user download portlet to admin user modify page
6: 986f6063b ! 6: 0c7811fbb Create test for user information TSV download
@@ -16,55 +16,61 @@
+
+use RT::Test tests => undef;
+
-+RT->Config->Set(UserDataSearchResultFormat => "'__id__', '__Subject__', '__Status__', '__QueueName__', '__Owner__', '__Priority__', '__Requestors__'");
++RT->Config->Set( UserDataSearchResultFormat =>
++ "'__id__', '__Subject__', '__Status__', '__QueueName__', '__Owner__', '__Priority__', '__Requestors__'"
++);
+
-+my ($baseurl, $agent) = RT::Test->started_ok;
++my ( $baseurl, $agent ) = RT::Test->started_ok;
+my $url = $agent->rt_base_url;
+
+# Login
-+$agent->login('root' => 'password');
++$agent->login( 'root' => 'password' );
+
+{
+ my $root = RT::Test->load_or_create_user( Name => 'root' );
+ ok $root && $root->id;
+
-+ # We want transactions attached to our user, so not using test method for ticket create
++# We want transactions attached to our user, so not using test method for ticket create
+ my $ticket = RT::Ticket->new($root);
-+ $ticket->Create( Subject => 'Test', Requestor => 'root', Queue => 'General' );
++ $ticket->Create(
++ Subject => 'Test',
++ Requestor => 'root',
++ Queue => 'General'
++ );
+ my $id = $ticket->id;
+ ok $id;
+
-+ $ticket->Comment(Content => 'Test - Comment');
-+ $ticket->Correspond(Content => 'Test - Reply');
++ $ticket->Comment( Content => 'Test - Comment' );
++ $ticket->Correspond( Content => 'Test - Reply' );
+
+ my @dates;
-+ # Transactions we are checking
-+ my $trans_checking = qr /Create Comment Correspond/;
+ my $trans = $ticket->Transactions;
+
-+ while (my $tran = $trans->Next) {
-+ if ( $trans_checking =~ $tran->Type ) {
++ while ( my $tran = $trans->Next ) {
++ if ( $tran->Type =~ /Create|Comment|Correspond/ ) {
+ push @dates, $tran->CreatedObj->AsString;
+ }
+ }
-+ my ($date_created, $date_commented, $date_correspondence) = @dates;
++ my ( $date_created, $date_commented, $date_correspondence ) = @dates;
++
+ # Make sure we have the expected amount of transactions
+ is scalar @dates, 3;
+
+ # TSV file for user record information
-+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
-+ $agent->follow_link_ok({ text => 'Download My User Info' });
++ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
++ $agent->follow_link_ok( { text => 'Download My User Info' } );
+
+ my $user_info_tsv = <<EOF;
+id\tName\tEmailAddress\tRealName\tNickName\tOrganization\tHomePhone\tWorkPhone\tMobilePhone\tPagerPhone\tAddress1\tAddress2\tCity\tState\tZip\tCountry\tGecos\tLang\tFreeFormContactInfo
+14\troot\troot\@localhost\tEnoch Root\t\t\t\t\t\t\t\t\t\t\t\t\troot\t\t
+EOF
+
-+ is $agent->content, $user_info_tsv, "User record information downloaded correctly";
++ is $agent->content, $user_info_tsv,
++ "User record information downloaded correctly";
+
+ # TSV file for Transactions
-+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
-+ $agent->follow_link_ok({ text => 'Download My Transaction Info' });
++ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
++ $agent->follow_link_ok( { text => 'Download My Transaction Info' } );
+
+ my $transaction_info_tsv = <<EOF;
+ObjectId\tid\tCreated\tDescription\tOldValue\tNewValue\tContent
@@ -73,11 +79,12 @@
+1\t33\t$date_correspondence\tCorrespondence added\t\t\tTest - Reply
+EOF
+
-+ is $agent->content, $transaction_info_tsv, "User transaction information downloaded correctly";
++ is $agent->content, $transaction_info_tsv,
++ "User transaction information downloaded correctly";
+
+ # TSV file for user's Tickets
-+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
-+ $agent->follow_link_ok({ text => 'Download My Tickets' });
++ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
++ $agent->follow_link_ok( { text => 'Download My Tickets' } );
+
+ my $ticket_info_tsv = <<EOF;
+id\tSubject\tStatus\tQueueName\tOwner\tPriority\tRequestors
More information about the rt-commit
mailing list