[Rt-commit] rt branch, watching-tool, updated. rt-3.8.8-754-gd782f96

Shawn Moore sartak at bestpractical.com
Fri Sep 10 16:56:45 EDT 2010


The branch, watching-tool has been updated
       via  d782f96437c35e847f0e297c5393e5b167ff0d83 (commit)
       via  e1b01a6ed13531af5b25f4b950208fc033655df3 (commit)
       via  fcb9ca126dd5f9e6b46cb4be68a3b02ee2121d48 (commit)
       via  6eef018b553a924de028d1c4794e1c118419148f (commit)
      from  e6da4841fad6c8a57c6cbcea1d75975965c205a5 (commit)

Summary of changes:
 t/web/watching-queues.t |   88 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 75 insertions(+), 13 deletions(-)

- Log -----------------------------------------------------------------
commit 6eef018b553a924de028d1c4794e1c118419148f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Sep 10 16:56:28 2010 -0400

    Load user only once

diff --git a/t/web/watching-queues.t b/t/web/watching-queues.t
index c90b834..13e40dd 100644
--- a/t/web/watching-queues.t
+++ b/t/web/watching-queues.t
@@ -7,6 +7,9 @@ my ($baseurl, $m) = RT::Test->started_ok;
 
 ok $m->login, 'logged in';
 
+my $user = RT::User->new($RT::SystemUser);
+$user->LoadByEmail('root at localhost');
+
 my $other_queue = RT::Queue->new($RT::SystemUser);
 $other_queue->Create(
     Name => 'Fancypants',
@@ -59,9 +62,6 @@ diag "add self as AdminCc on General" if $ENV{'TEST_VERBOSE'};
 
     $m->title_is('Modify people related to queue General', 'caught the right form! :)');
 
-    my $user = RT::User->new($RT::SystemUser);
-    $user->LoadByEmail('root at localhost');
-
     $m->submit_form_ok({
         form_number => 3,
         fields => {
@@ -117,9 +117,6 @@ diag "add self as Cc on General" if $ENV{'TEST_VERBOSE'};
 
     $m->title_is('Modify people related to queue General', 'caught the right form! :)');
 
-    my $user = RT::User->new($RT::SystemUser);
-    $user->LoadByEmail('root at localhost');
-
     $m->submit_form_ok({
         form_number => 3,
         fields => {
@@ -175,9 +172,6 @@ diag "add self as AdminCc on Fancypants" if $ENV{'TEST_VERBOSE'};
 
     $m->title_is('Modify people related to queue Fancypants', 'caught the right form! :)');
 
-    my $user = RT::User->new($RT::SystemUser);
-    $user->LoadByEmail('root at localhost');
-
     $m->submit_form_ok({
         form_number => 3,
         fields => {

commit fcb9ca126dd5f9e6b46cb4be68a3b02ee2121d48
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Sep 10 16:56:38 2010 -0400

    PrincipalId not id

diff --git a/t/web/watching-queues.t b/t/web/watching-queues.t
index 13e40dd..c443b30 100644
--- a/t/web/watching-queues.t
+++ b/t/web/watching-queues.t
@@ -65,7 +65,7 @@ diag "add self as AdminCc on General" if $ENV{'TEST_VERBOSE'};
     $m->submit_form_ok({
         form_number => 3,
         fields => {
-            'Queue-AddWatcher-Principal-' . $user->id => 'AdminCc',
+            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'AdminCc',
         },
     });
 
@@ -120,7 +120,7 @@ diag "add self as Cc on General" if $ENV{'TEST_VERBOSE'};
     $m->submit_form_ok({
         form_number => 3,
         fields => {
-            'Queue-AddWatcher-Principal-' . $user->id => 'Cc',
+            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'Cc',
         },
     });
 
@@ -175,7 +175,7 @@ diag "add self as AdminCc on Fancypants" if $ENV{'TEST_VERBOSE'};
     $m->submit_form_ok({
         form_number => 3,
         fields => {
-            'Queue-AddWatcher-Principal-' . $user->id => 'AdminCc',
+            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'AdminCc',
         },
     });
 

commit e1b01a6ed13531af5b25f4b950208fc033655df3
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Sep 10 16:59:21 2010 -0400

    Begin adding group tests

diff --git a/t/web/watching-queues.t b/t/web/watching-queues.t
index c443b30..f118ced 100644
--- a/t/web/watching-queues.t
+++ b/t/web/watching-queues.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 45;
+use RT::Test tests => 58;
 use Web::Scraper;
 my ($baseurl, $m) = RT::Test->started_ok;
 
@@ -15,6 +15,16 @@ $other_queue->Create(
     Name => 'Fancypants',
 );
 
+my $loopy_queue = RT::Queue->new($RT::SystemUser);
+$loopy_queue->Create(
+    Name => 'Loopy',
+);
+
+my $group = RT::Group->new($RT::SystemUser);
+$group->CreateUserDefinedGroup(
+    Name => 'Groupies',
+);
+
 my $watching = scraper {
     process "li.queue-roles", 'queues[]' => scraper {
         # trim the queue name
@@ -207,3 +217,60 @@ diag "check watching page" if $ENV{'TEST_VERBOSE'};
     });
 }
 
+diag "add group as Cc on Loopy" if $ENV{'TEST_VERBOSE'};
+{
+    $m->follow_link( text => 'Configuration' );
+    $m->title_is('RT Administration', 'admin page');
+    $m->follow_link( text => 'Queues' );
+    $m->title_is('Admin queues', 'queues page');
+    $m->follow_link( text => 'Loopy' );
+    $m->title_is('Editing Configuration for queue Loopy');
+    $m->follow_link( text => 'Watchers' );
+    $m->title_is('Modify people related to queue Loopy');
+
+    $m->submit_form_ok({
+        form_number => 3,
+        fields => {
+            GroupField  => 'Name',
+            GroupOp     => 'LIKE',
+            GroupString => 'Groupies',
+        },
+    });
+
+    $m->title_is('Modify people related to queue Loopy', 'caught the right form! :)');
+
+    $m->submit_form_ok({
+        form_number => 3,
+        fields => {
+            'Queue-AddWatcher-Principal-' . $group->PrincipalId => 'Cc',
+        },
+    });
+
+    $m->title_is('Modify people related to queue Loopy', 'caught the right form! :)');
+
+    ok($loopy_queue->IsWatcher(Type => 'Cc', PrincipalId => $group->PrincipalId), 'added Groupies as Cc on Loopy');
+}
+
+diag "check watching page (no change since root is not a groupy)" if $ENV{'TEST_VERBOSE'};
+{
+    $m->follow_link( text => 'Tools' );
+    $m->title_is('Tools', 'tools screen');
+    $m->follow_link( text => 'Watching Queues' );
+    $m->title_is('Watching Queues', 'watching screen');
+
+    $m->content_lacks('You are not watching any queues.');
+
+    is_deeply($watching->scrape($m->content), {
+        queues => [
+            {
+                name  => 'Fancypants',
+                roles => ['AdminCc'],
+            },
+            {
+                name  => 'General',
+                roles => ['Cc', 'AdminCc'],
+            },
+        ],
+    });
+}
+

commit d782f96437c35e847f0e297c5393e5b167ff0d83
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Sep 10 16:59:29 2010 -0400

    Silence undef warning by describing the group

diff --git a/t/web/watching-queues.t b/t/web/watching-queues.t
index f118ced..2b07258 100644
--- a/t/web/watching-queues.t
+++ b/t/web/watching-queues.t
@@ -23,6 +23,7 @@ $loopy_queue->Create(
 my $group = RT::Group->new($RT::SystemUser);
 $group->CreateUserDefinedGroup(
     Name => 'Groupies',
+    Description => 'for the Metallica Speed of Sound tour',
 );
 
 my $watching = scraper {

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


More information about the Rt-commit mailing list