[Rt-commit] rt branch, menuing, updated. rt-3.9.4-230-gcdb9765

? sunnavy sunnavy at bestpractical.com
Tue Nov 2 04:03:58 EDT 2010


The branch, menuing has been updated
       via  cdb9765f9f355857ce701102db7e4bb5ccb67a2e (commit)
       via  299921b419e4a79d412a7d8d90b3320bd61e0636 (commit)
       via  9eb1d5bf61a92090cf74500f4c592a9ada4524e5 (commit)
       via  4acbbf241a2845d0bc35208a80b03fb9e21f4590 (commit)
      from  4ea455428995526a7199ff65e8cb9f8e45f360fc (commit)

Summary of changes:
 share/html/Elements/Tabs          |   14 +++---
 t/web/dashboards-groups.t         |   23 +++++-----
 t/web/dashboards.t                |   24 ++++++-----
 t/web/ticket_owner_autocomplete.t |    6 +-
 t/web/walk.t                      |   87 ++++++++++++++++++-------------------
 5 files changed, 78 insertions(+), 76 deletions(-)

- Log -----------------------------------------------------------------
commit 4acbbf241a2845d0bc35208a80b03fb9e21f4590
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 2 14:52:08 2010 +0800

    fix dashboards tests

diff --git a/t/web/dashboards-groups.t b/t/web/dashboards-groups.t
index 4f90e77..668fa84 100644
--- a/t/web/dashboards-groups.t
+++ b/t/web/dashboards-groups.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test nodata => 1, tests => 39;
+use RT::Test nodata => 1, tests => 35;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 my $url = $m->rt_base_url;
@@ -60,7 +60,6 @@ is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::User
 $m->content_lacks('Delete', "Delete button hidden because we are creating");
 
 $user_obj->PrincipalObj->GrantRight(Right => 'CreateGroupDashboard', Object => $inner_group);
-$user_obj->PrincipalObj->GrantRight(Right => 'SeeGroupDashboard', Object => $inner_group);
 
 $m->follow_link_ok({ id => 'tools-dashboards-create'});
 $m->form_name('ModifyDashboard');
@@ -70,9 +69,17 @@ $m->field("Privacy" => "RT::Group-" . $inner_group->Id);
 $m->content_lacks('Delete', "Delete button hidden because we are creating");
 
 $m->click_button(value => 'Create');
-$m->content_lacks("No permission to create dashboards");
+
+$m->content_contains("Permission denied", "we lack SeeGroupDashboard");
+$user_obj->PrincipalObj->GrantRight(
+    Right  => 'SeeGroupDashboard',
+    Object => $inner_group,
+);
+$m->reload;
+$m->content_lacks("Permission denied", "we now have SeeGroupDashboard");
 $m->content_contains("Saved dashboard inner dashboard");
 $m->content_lacks('Delete', "Delete button hidden because we lack DeleteDashboard");
+
 my $dashboard = RT::Dashboard->new($currentuser);
 my ($id) = $m->content =~ /name="id" value="(\d+)"/;
 ok($id, "got an ID, $id");
@@ -82,18 +89,10 @@ is($dashboard->Name, "inner dashboard");
 is($dashboard->Privacy, 'RT::Group-' . $inner_group->Id, "correct privacy");
 is($dashboard->PossibleHiddenSearches, 0, "all searches are visible");
 
-$m->no_warnings_ok;
-
-$m->get_ok("/Dashboards/Modify.html?id=$id");
-$m->content_lacks("inner dashboard", "no SeeGroupDashboard right");
-$m->content_contains("Permission denied");
-
-$m->warning_like(qr/Permission denied/, "got a permission denied warning");
+$m->warning_like(qr/Permission denied/, "got a permission denied warning when trying to see the dashboard");
 
-$user_obj->PrincipalObj->GrantRight(Right => 'SeeGroupDashboard', Object => $inner_group);
 $m->get_ok("/Dashboards/Modify.html?id=$id");
 $m->content_contains("inner dashboard", "we now have SeeGroupDashboard right");
 $m->content_lacks("Permission denied");
-
 $m->content_contains('Subscription', "Subscription link not hidden because we have SubscribeDashboard");
 
diff --git a/t/web/dashboards.t b/t/web/dashboards.t
index a1ed228..b5d07d9 100644
--- a/t/web/dashboards.t
+++ b/t/web/dashboards.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 109;
+use RT::Test tests => 110;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 my $url = $m->rt_base_url;
@@ -63,20 +63,19 @@ $m->content_contains("Create");
 
 $m->get_ok($url."Dashboards/index.html");
 $m->content_contains("New", "'New' link because we now have ModifyOwnDashboard");
-
 $m->follow_link_ok({ id => 'tools-dashboards-create'});
 $m->form_name('ModifyDashboard');
 $m->field("Name" => 'different dashboard');
 $m->content_lacks('Delete', "Delete button hidden because we are creating");
 $m->click_button(value => 'Create');
-$m->content_lacks("No permission to create dashboards");
-$m->content_contains("Saved dashboard different dashboard");
-$m->content_lacks('Delete', "Delete button hidden because we lack DeleteOwnDashboard");
-
-$m->get_ok($url."Dashboards/index.html");
-$m->content_lacks("different dashboard", "we lack SeeOwnDashboard");
 
+$m->content_contains("Permission denied", "we lack SeeOwnDashboard");
 $user_obj->PrincipalObj->GrantRight(Right => 'SeeOwnDashboard', Object => $RT::System);
+$m->reload;
+$m->content_lacks("Permission denied", "we now have SeeOwnDashboard");
+$m->content_contains("Saved dashboard different dashboard");
+$m->content_lacks('Delete', "Delete button hidden because we lack DeleteOwnDashboard");
+$m->warning_like(qr/Permission denied/, "got a permission denied warning when trying to see the dashboard");
 
 $m->get_ok($url."Dashboards/index.html");
 $m->content_contains("different dashboard", "we now have SeeOwnDashboard");
@@ -144,13 +143,15 @@ $ticket->Create(
 $m->follow_link_ok({id => 'page-show'});
 $m->content_contains("50 highest priority tickets I own");
 $m->content_contains("50 newest unowned tickets");
-$m->content_lacks("Bookmarked Tickets");
+$m->content_unlike( qr/Bookmarked Tickets.*Bookmarked Tickets/s,
+    'only dashboard queries show up' );
 $m->content_contains("dashboard test", "ticket subject");
 
 $m->get_ok("/Dashboards/$id/This fragment left intentionally blank");
 $m->content_contains("50 highest priority tickets I own");
 $m->content_contains("50 newest unowned tickets");
-$m->content_lacks("Bookmarked Tickets");
+$m->content_unlike( qr/Bookmarked Tickets.*Bookmarked Tickets/s,
+    'only dashboard queries show up' );
 $m->content_contains("dashboard test", "ticket subject");
 
 $m->get_ok("/Dashboards/Subscription.html?id=$id");
@@ -169,7 +170,8 @@ $m->follow_link_ok({text => "Subscription"});
 $m->content_contains("Subscribe to dashboard different dashboard");
 $m->content_contains("Unowned Tickets");
 $m->content_contains("My Tickets");
-$m->content_lacks("Bookmarked Tickets", "only dashboard queries show up");
+$m->content_unlike( qr/Bookmarked Tickets.*Bookmarked Tickets/s,
+    'only dashboard queries show up' );
 
 $m->form_name('SubscribeDashboard');
 $m->click_button(name => 'Save');

commit 9eb1d5bf61a92090cf74500f4c592a9ada4524e5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 2 14:58:38 2010 +0800

    fix ticket_owner_autocomplete.t: we meant the reply page

diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 84cf0a9..0da37dd 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -127,10 +127,10 @@ diag "on reply correct owner is selected";
     ok $id, 'created a ticket #'. $id or diag "error: $msg";
     is $ticket->Owner, $user_b->id, 'correct owner';
 
-    $agent_a->goto_ticket( $id );
-    $agent_a->follow_link_ok({id => 'page-basics'}, 'Ticket -> Basics');
+    $agent_a->goto_ticket($id);
+    $agent_a->follow_link_ok( { id => 'page-transitions-reply' }, 'Reply' );
 
-    my $form = $agent_a->form_name('TicketModify');
+    my $form = $agent_a->form_number(3);
     is $form->value('Owner'), '', 'empty value selected';
     $agent_a->submit;
 

commit 299921b419e4a79d412a7d8d90b3320bd61e0636
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 2 16:03:15 2010 +0800

    tabs fixes

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 41bf8e5..e048e84 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -152,7 +152,7 @@ if ( $request_path =~ qr{.*} ) {
                            path   => '/Admin/Global/', );
 
         my $scrips = $admin_global->child( loc('Scrips'),
-                                        path => '/Admin/Global/Scripshtml', );
+                                        path => '/Admin/Global/Scrips.html', );
         $scrips->child( loc('Select'), path => "/Admin/Global/Scrips.html" );
         $scrips->child( loc('Create'),
                         path => "/Admin/Global/Scrip.html?Create=1" );
@@ -211,13 +211,15 @@ if ( $request_path =~ qr{.*} ) {
                               path => '/Admin/Global/UserRights.html', );
         $admin_global->child( loc('RT at a glance'),
                               path => '/Admin/Global/MyRT.html', );
-        $admin_global->child( loc('System'),
-                              path => '/Admin/Global/System.html', );
+        $admin_global->child( loc('Theme'),
+                              path => '/Admin/Global/Theme.html', );
 
         my $admin_tools
             = $admin->child( loc('Tools'), path => '/Admin/Tools/', );
         $admin_tools->child( loc('System Configuration'),
                              path => '/Admin/Tools/Configuration.html', );
+        $admin_tools->child( loc('SQL Queries'),
+                             path => '/Admin/Tools/Queries.html', );
         $admin_tools->child( loc('Shredder'),
                              path => '/Admin/Tools/Shredder', );
     }
@@ -267,7 +269,7 @@ if ( $request_path =~ qr{.*} ) {
        )
     {
         $about_me->child( logout => title => loc('Logout'),
-                          path   => 'NoAuth/Logout.html' );
+                          path   => '/NoAuth/Logout.html' );
     }
 }
 if ( $request_path =~ qr'Dashboards/(\d+)?' ) {
@@ -420,11 +422,11 @@ if ( $request_path =~ qr'Admin/Groups' ) {
                 loc('Create') => path => "/Admin/Groups/Modify.html?Create=1",
                 separator     => 1 );
     if ( my $id = $m->request_args->{'id'} ) {
-        my $obj = RT::User->new( $session{'CurrentUser'} );
+        my $obj = RT::Group->new( $session{'CurrentUser'} );
         $obj->Load($id);
         if ( $obj->id ) {
             my $tabs = PageMenu->child( $obj->Name,
-                        path => "/Admin/CustomFields/Modify.html?id=" . $id );
+                        path => "/Admin/Groups/Modify.html?id=" . $id );
             $tabs->child(
                       loc('Basics') => path => "/Admin/Groups/Modify.html?id="
                           . $obj->id );

commit cdb9765f9f355857ce701102db7e4bb5ccb67a2e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 2 16:03:32 2010 +0800

    update walk.t

diff --git a/t/web/walk.t b/t/web/walk.t
index 87a78c2..af41398 100644
--- a/t/web/walk.t
+++ b/t/web/walk.t
@@ -52,8 +52,8 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
         $m->back;
 
         $m->follow_link_ok( { text => 'root' }, '-> root' );
-        for my $tab ( 'History', 'Memberships', 'RT at a glance', 'Basics' ) {
-            $m->follow_link_ok( { text => $tab }, "-> $tab" );
+        for my $id ( 'rt-at-a-glance', 'memberships', 'history', 'basics' ) {
+            $m->follow_link_ok( { id => 'page-current-' . $id }, "-> $id" );
         }
     }
 
@@ -69,10 +69,10 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
         $m->back;
 
         $m->follow_link_ok( { text => 'group_foo' }, '-> group_foo' );
-        for my $tab ( 'History', 'Members', 'Group Rights', 'User Rights',
-            'Basics' )
+        for my $id ( 'history', 'members', 'group-rights', 'user-rights',
+            'basics' )
         {
-            $m->follow_link_ok( { text => $tab }, "-> $tab" );
+            $m->follow_link_ok( { id => 'page-group_foo-' . $id }, "-> $id" );
         }
     }
 
@@ -85,22 +85,27 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
         $m->back;
 
         $m->follow_link_ok( { text => 'General' }, '-> General' );
-        for my $tab (
-            'Watchers',                  'Scrips',
-            'Templates',                 'Ticket Custom Fields',
-            'Transaction Custom Fields', 'Group Rights',
-            'User Rights',               'History',
-            'Basics',
+        for my $id (
+            'people',                    'scrips',
+            'templates',                 'ticket-custom-fields',
+            'transaction-custom-fields', 'group-rights',
+            'user-rights',               'basics',
           )
         {
-            $m->follow_link_ok( { text => $tab }, "-> $tab" );
+            $m->follow_link_ok( { id => 'page-' . $id }, "-> $id" );
         }
     }
 
     diag 'walk into /Admin/CustomFields' if $ENV{TEST_VERBOSE};
     {
         my $cf = RT::CustomField->new($RT::SystemUser);
-        ok( $cf->Create( Name => 'cf_foo', Type => 'Freeform' ) );
+        ok(
+            $cf->Create(
+                Name       => 'cf_foo',
+                Type       => 'Freeform',
+                LookupType => 'RT::Queue-RT::Ticket',
+            )
+        );
         $m->get_ok( $baseurl, 'homepage' );
         $m->follow_link_ok( { text => 'Configuration' }, '-> Configuration' );
         $m->follow_link_ok( { text => 'Custom Fields' }, '-> Custom Fields' );
@@ -109,12 +114,8 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
 
         $m->follow_link_ok( { text => 'cf_foo' }, '-> cf_foo' );
 
-        for my $tab ( 'Applies to', 'Group Rights', 'User Rights', 'Basics' ) {
-
-            # very weird, 'Applies to' fails with ->follow_link_ok
-            #        $m->follow_link_ok( { text => $tab }, "-> $tab" );
-            $m->follow_link( text => $tab );
-            is( $m->status, 200, "-> $tab" );
+        for my $id ( 'applies-to', 'group-rights', 'user-rights', 'basics' ) {
+            $m->follow_link_ok( { id => 'page-cf_foo-' . $id }, "-> $id" );
         }
     }
 
@@ -124,11 +125,9 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
         $m->follow_link_ok( { text => 'Configuration' }, '-> Configuration' );
         $m->follow_link_ok( { text => 'Tools' },         '-> Tools' );
 
-        for my $tab ( 'System Configuration', 'SQL Queries', 'Shredder' ) {
-
-            #            $m->follow_link_ok( { text => $tab }, "-> $stab" );
-            $m->follow_link( text => $tab );
-            is( $m->status, 200, "-> $tab" );
+        for my $tab ( 'Configuration.html', 'Queries.html', 'Shredder' ) {
+            $m->follow_link_ok( { url_regex => qr!/Admin/Tools/$tab! },
+                "-> /Admin/Tools/$tab" );
         }
     }
 
@@ -138,32 +137,21 @@ diag 'walk into /Admin' if $ENV{TEST_VERBOSE};
         $m->follow_link_ok( { text => 'Configuration' }, '-> Configuration' );
         $m->follow_link_ok( { text => 'Global' },        '-> Global' );
 
-        for my $tab ( 'Group Rights', 'User Rights', 'RT at a glance', 'Theme' )
+        for my $id ( 'group-rights', 'user-rights', 'rt-at-a-glance', 'theme' )
         {
-            $m->follow_link_ok( { text => $tab }, "-> $tab" );
+            $m->follow_link_ok( { id => 'config-global-' . $id }, "-> $id" );
         }
 
-        for my $tab ( 'Scrips', 'Templates' ) {
-            $m->follow_link_ok( { text => 'Global' }, '-> Global' );
-            $m->follow_link_ok( { text => $tab },     "-> $tab" );
-            $m->follow_link_ok( { text => 'Create' }, '-> Create' );
-            $m->back;
-            $m->follow_link_ok( { text => '1' },      '-> 1' );
-            $m->follow_link_ok( { text => 'Select' }, '-> Select' );
+        for my $tab ( 'scrips', 'templates' ) {
+            $m->follow_link_ok( { id => "config-global-" . $tab }, "-> $tab" );
+            for my $id (qw/create select/) {
+                $m->follow_link_ok( { id => "config-global-" . $tab . "-$id" },
+                    "-> $id" );
+            }
+            $m->follow_link_ok( { text => '1' }, '-> 1' );
         }
     }
 
-    diag 'walk into /Prefs' if $ENV{TEST_VERBOSE};
-    {
-        $m->get_ok( $baseurl, 'homepage' );
-        $m->follow_link_ok( { text => 'Preferences' }, '-> Preferences' );
-
-        for
-          my $tab ( 'Settings', 'About me', 'Search options', 'RT at a glance' )
-        {
-            $m->follow_link_ok( { text => $tab }, "-> $tab" );
-        }
-    }
 }
 
 diag 'walk into /Approvals' if $ENV{TEST_VERBOSE};
@@ -175,3 +163,14 @@ diag 'walk into /Approvals' if $ENV{TEST_VERBOSE};
     is( $m->status, 200, '-> Approvals' );
 }
 
+diag 'walk into /Prefs' if $ENV{TEST_VERBOSE};
+{
+    for my $id (
+        'settings',    'about_me', 'search_options', 'myrt',
+        'quicksearch', 'search-0', 'search-1',       'search-2',
+        'logout'
+      )
+    {
+        $m->follow_link_ok( { id => 'preferences-' . $id }, "-> $id" );
+    }
+}

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


More information about the Rt-commit mailing list