[Rt-commit] rt branch, 4.4/download-user-info, updated. rt-4.4.2-246-g809b31640

Craig Kaiser craig at bestpractical.com
Mon May 21 15:52:21 EDT 2018


The branch, 4.4/download-user-info has been updated
       via  809b31640af0757fd51ad3861041acf66f3b23c6 (commit)
       via  06fac2bad8dbbecfc0c0df32a532ecf82720be0b (commit)
       via  fab36017bec12a242687235cbeb111032e6455ce (commit)
      from  43b9b1a351a3b920972770915fc256d31863e90e (commit)

Summary of changes:
 t/download_user_info.t | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 t/download_user_info.t

- Log -----------------------------------------------------------------
commit fab36017bec12a242687235cbeb111032e6455ce
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Mon May 21 15:10:53 2018 -0400

    Add test for user tsv info download

diff --git a/t/download_user_info.t b/t/download_user_info.t
new file mode 100644
index 000000000..fcbe81883
--- /dev/null
+++ b/t/download_user_info.t
@@ -0,0 +1,39 @@
+
+use strict;
+use warnings;
+use RT;
+use RT::Test tests => undef;
+
+{
+ok(require RT::User);
+}
+
+my ($baseurl, $agent) = RT::Test->started_ok;
+my $url = $agent->rt_base_url;
+
+# 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");
+}
+
+# Testing GDPR features
+{
+    my $root = RT::Test->load_or_create_user( Name => 'root' );
+    ok $root && $root->id;
+
+    my $queue = RT::Test->load_or_create_queue( Name => 'General' );
+    ok $queue && $queue->id;
+
+    $agent->get( $url . "/Helpers/Results.tsv?Type=User&id=" . $root->id );
+    ok $agent;
+
+    my @info = split '	', $agent->res->{_content};;
+    is($info[19], 'root');
+    is($info[20], 'root at localhost');
+    is($info[21], 'Enoch Root');
+}
+
+done_testing();
\ No newline at end of file

commit 06fac2bad8dbbecfc0c0df32a532ecf82720be0b
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Mon May 21 15:27:52 2018 -0400

    Add test for user tickets download

diff --git a/t/download_user_info.t b/t/download_user_info.t
index fcbe81883..e4dc83898 100644
--- a/t/download_user_info.t
+++ b/t/download_user_info.t
@@ -31,9 +31,22 @@ my $url = $agent->rt_base_url;
     ok $agent;
 
     my @info = split '	', $agent->res->{_content};;
-    is($info[19], 'root');
-    is($info[20], 'root at localhost');
-    is($info[21], 'Enoch Root');
+    is($info[19], 'root', 'Name exported correctly');
+    is($info[20], 'root at localhost', 'EmailAddress exported correctly');
+    is($info[21], 'Enoch Root', 'RealName exported correctly');
+
+    my $ticket = RT::Ticket->new( $root );
+    my ($id) = $ticket->Create( Subject => 'test', Requestor => 'root', Queue => $queue );
+    ok $id;
+
+    $agent->get( $url . "/Helpers/Results.tsv?Query=Requestor.id=" . $root->id );
+    ok $agent;
+
+    my @data = split '	', $agent->res->{_content};
+    is($data[11], 'test', 'Subject exported correcty');
+    is($data[12], 'new', 'Status exported correctly');
+    is($data[13], 'General', 'Queue exported correctly');
+    is($data[16], 'root (Enoch Root)', 'Requestors exported correctly');
 }
 
 done_testing();
\ No newline at end of file

commit 809b31640af0757fd51ad3861041acf66f3b23c6
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Mon May 21 15:43:05 2018 -0400

    Add test for user transaction download

diff --git a/t/download_user_info.t b/t/download_user_info.t
index e4dc83898..e775d905b 100644
--- a/t/download_user_info.t
+++ b/t/download_user_info.t
@@ -47,6 +47,16 @@ my $url = $agent->rt_base_url;
     is($data[12], 'new', 'Status exported correctly');
     is($data[13], 'General', 'Queue exported correctly');
     is($data[16], 'root (Enoch Root)', 'Requestors exported correctly');
+
+    $ticket->LoadById( $id );
+    $ticket->Comment(Content => 'Test');
+
+    $agent->get( $url . "/Helpers/Results.tsv?Type=Transaction&UserId=" . $root->id );
+    ok $agent;
+
+    @data = split '	', $agent->res->{_content};
+    is($data[12], "Test\n", 'Transaction content correct');
+    is($data[9], 'Comments added', 'Transaction description correct');
 }
 
 done_testing();
\ No newline at end of file

-----------------------------------------------------------------------


More information about the rt-commit mailing list